diff options
| author | Chong Yidong | 2012-04-22 21:58:00 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-04-22 21:58:00 +0800 |
| commit | cf20dee0248049a925275f54381cf63bb2017e35 (patch) | |
| tree | 0a7922c4ea3258733023c58cf50d8fe1a60e7b43 /lisp/wid-edit.el | |
| parent | 583e23bd57621892cce187359afd952f7850e7bc (diff) | |
| download | emacs-cf20dee0248049a925275f54381cf63bb2017e35.tar.gz emacs-cf20dee0248049a925275f54381cf63bb2017e35.zip | |
Tweaks to Customize interface. Set custom-reset-button-menu to t.
* cus-edit.el (custom-commands, custom-reset-menu)
(Custom-reset-standard): Tweak labels.
(custom-reset-button-menu): Change default to t.
(custom-buffer-create-internal): For the custom-reset-button-menu
case, put the revert button first.
(custom-group-subtitle): New face.
(custom-group-value-create): Align docstring to a specific column.
* wid-edit.el (widget-documentation-link-add): Don't handle
indentation in this function.
(widget-documentation-string-indent-to): New function.
(widget-documentation-string-value-create): Use it.
* autorevert.el (auto-revert):
* epg-config.el (epg):
* ibuffer.el (ibuffer):
* mpc.el (mpc):
* ses.el (ses):
* eshell/eshell.el (eshell):
* net/ange-ftp.el (ange-ftp):
* progmodes/ebnf2ps.el (postscript):
* progmodes/flymake.el (flymake):
* progmodes/prolog.el (prolog):
* progmodes/verilog-mode.el (verilog-mode):
* progmodes/which-func.el (which-func):
* textmodes/picture.el (picture):
* textmodes/tildify.el (tildify):
* vc/ediff.el (ediff): Tweak defgroups to improve presentation in
customization buffers.
Diffstat (limited to 'lisp/wid-edit.el')
| -rw-r--r-- | lisp/wid-edit.el | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index b6feecebde5..9c5c6462bcc 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el | |||
| @@ -2907,15 +2907,7 @@ link for that string." | |||
| 2907 | (push (widget-convert-button widget-documentation-link-type | 2907 | (push (widget-convert-button widget-documentation-link-type |
| 2908 | begin end :value name) | 2908 | begin end :value name) |
| 2909 | buttons))))) | 2909 | buttons))))) |
| 2910 | (widget-put widget :buttons buttons))) | 2910 | (widget-put widget :buttons buttons)))) |
| 2911 | (let ((indent (widget-get widget :indent))) | ||
| 2912 | (when (and indent (not (zerop indent))) | ||
| 2913 | (save-excursion | ||
| 2914 | (save-restriction | ||
| 2915 | (narrow-to-region from to) | ||
| 2916 | (goto-char (point-min)) | ||
| 2917 | (while (search-forward "\n" nil t) | ||
| 2918 | (insert-char ?\s indent))))))) | ||
| 2919 | 2911 | ||
| 2920 | ;;; The `documentation-string' Widget. | 2912 | ;;; The `documentation-string' Widget. |
| 2921 | 2913 | ||
| @@ -2934,10 +2926,9 @@ link for that string." | |||
| 2934 | (start (point))) | 2926 | (start (point))) |
| 2935 | (if (string-match "\n" doc) | 2927 | (if (string-match "\n" doc) |
| 2936 | (let ((before (substring doc 0 (match-beginning 0))) | 2928 | (let ((before (substring doc 0 (match-beginning 0))) |
| 2937 | (after (substring doc (match-beginning 0))) | 2929 | (after (substring doc (match-end 0))) |
| 2938 | button) | 2930 | button end) |
| 2939 | (when (and indent (not (zerop indent))) | 2931 | (widget-documentation-string-indent-to indent) |
| 2940 | (insert-char ?\s indent)) | ||
| 2941 | (insert before ?\s) | 2932 | (insert before ?\s) |
| 2942 | (widget-documentation-link-add widget start (point)) | 2933 | (widget-documentation-link-add widget start (point)) |
| 2943 | (setq button | 2934 | (setq button |
| @@ -2950,18 +2941,35 @@ link for that string." | |||
| 2950 | :action 'widget-parent-action | 2941 | :action 'widget-parent-action |
| 2951 | shown)) | 2942 | shown)) |
| 2952 | (when shown | 2943 | (when shown |
| 2944 | (insert ?\n) | ||
| 2953 | (setq start (point)) | 2945 | (setq start (point)) |
| 2954 | (when (and indent (not (zerop indent))) | 2946 | (when (and indent (not (zerop indent))) |
| 2955 | (insert-char ?\s indent)) | 2947 | (insert-char ?\s indent)) |
| 2956 | (insert after) | 2948 | (insert after) |
| 2957 | (widget-documentation-link-add widget start (point))) | 2949 | (setq end (point)) |
| 2950 | (widget-documentation-link-add widget start end) | ||
| 2951 | ;; Indent the subsequent lines. | ||
| 2952 | (when (and indent (> indent 0)) | ||
| 2953 | (save-excursion | ||
| 2954 | (save-restriction | ||
| 2955 | (narrow-to-region start end) | ||
| 2956 | (goto-char (point-min)) | ||
| 2957 | (while (search-forward "\n" nil t) | ||
| 2958 | (widget-documentation-string-indent-to indent)))))) | ||
| 2958 | (widget-put widget :buttons (list button))) | 2959 | (widget-put widget :buttons (list button))) |
| 2959 | (when (and indent (not (zerop indent))) | 2960 | (widget-documentation-string-indent-to indent) |
| 2960 | (insert-char ?\s indent)) | ||
| 2961 | (insert doc) | 2961 | (insert doc) |
| 2962 | (widget-documentation-link-add widget start (point)))) | 2962 | (widget-documentation-link-add widget start (point)))) |
| 2963 | (insert ?\n)) | 2963 | (insert ?\n)) |
| 2964 | 2964 | ||
| 2965 | (defun widget-documentation-string-indent-to (col) | ||
| 2966 | (when (and (numberp col) | ||
| 2967 | (> col 0)) | ||
| 2968 | (let ((opoint (point))) | ||
| 2969 | (indent-to col) | ||
| 2970 | (put-text-property opoint (point) | ||
| 2971 | 'display `(space :align-to ,col))))) | ||
| 2972 | |||
| 2965 | (defun widget-documentation-string-action (widget &rest _ignore) | 2973 | (defun widget-documentation-string-action (widget &rest _ignore) |
| 2966 | ;; Toggle documentation. | 2974 | ;; Toggle documentation. |
| 2967 | (let ((parent (widget-get widget :parent))) | 2975 | (let ((parent (widget-get widget :parent))) |