aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/cus-edit.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r--lisp/cus-edit.el39
1 files changed, 29 insertions, 10 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 951b14f7f05..9e0efc5d3d0 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1012,11 +1012,11 @@ version."
1012 1012
1013;;;###autoload 1013;;;###autoload
1014(defun customize-face (&optional face) 1014(defun customize-face (&optional face)
1015 "Customize SYMBOL, which should be a face name or nil. 1015 "Customize FACE, which should be a face name or nil.
1016If SYMBOL is nil, customize all faces. 1016If FACE is nil, customize all faces.
1017 1017
1018Interactively, when point is on text which has a face specified, 1018Interactively, when point is on text which has a face specified,
1019suggest to customized that face, if it's customizable." 1019suggest to customize that face, if it's customizable."
1020 (interactive 1020 (interactive
1021 (list (read-face-name "Customize face" "all faces" t))) 1021 (list (read-face-name "Customize face" "all faces" t)))
1022 (if (member face '(nil "")) 1022 (if (member face '(nil ""))
@@ -1038,10 +1038,10 @@ suggest to customized that face, if it's customizable."
1038 1038
1039;;;###autoload 1039;;;###autoload
1040(defun customize-face-other-window (&optional face) 1040(defun customize-face-other-window (&optional face)
1041 "Show customization buffer for face SYMBOL in other window. 1041 "Show customization buffer for face FACE in other window.
1042 1042
1043Interactively, when point is on text which has a face specified, 1043Interactively, when point is on text which has a face specified,
1044suggest to customized that face, if it's customizable." 1044suggest to customize that face, if it's customizable."
1045 (interactive 1045 (interactive
1046 (list (read-face-name "Customize face" "all faces" t))) 1046 (list (read-face-name "Customize face" "all faces" t)))
1047 (if (member face '(nil "")) 1047 (if (member face '(nil ""))
@@ -1093,7 +1093,7 @@ suggest to customized that face, if it's customizable."
1093 (get symbol 'standard-value)))) 1093 (get symbol 'standard-value))))
1094 (when (and cval ;Declared with defcustom. 1094 (when (and cval ;Declared with defcustom.
1095 (default-boundp symbol) ;Has a value. 1095 (default-boundp symbol) ;Has a value.
1096 (not (equal (eval (car cval)) 1096 (not (equal (eval (car cval))
1097 ;; Which does not match customize. 1097 ;; Which does not match customize.
1098 (default-value symbol)))) 1098 (default-value symbol))))
1099 (push (list symbol 'custom-variable) found))))) 1099 (push (list symbol 'custom-variable) found)))))
@@ -1876,7 +1876,7 @@ and `face'."
1876 (custom-load-symbol (widget-value widget))) 1876 (custom-load-symbol (widget-value widget)))
1877 1877
1878(defun custom-unloaded-symbol-p (symbol) 1878(defun custom-unloaded-symbol-p (symbol)
1879 "Return non-nil if the dependencies of SYMBOL has not yet been loaded." 1879 "Return non-nil if the dependencies of SYMBOL have not yet been loaded."
1880 (let ((found nil) 1880 (let ((found nil)
1881 (loads (get symbol 'custom-loads)) 1881 (loads (get symbol 'custom-loads))
1882 load) 1882 load)
@@ -1894,7 +1894,7 @@ and `face'."
1894 found)) 1894 found))
1895 1895
1896(defun custom-unloaded-widget-p (widget) 1896(defun custom-unloaded-widget-p (widget)
1897 "Return non-nil if the dependencies of WIDGET has not yet been loaded." 1897 "Return non-nil if the dependencies of WIDGET have not yet been loaded."
1898 (custom-unloaded-symbol-p (widget-value widget))) 1898 (custom-unloaded-symbol-p (widget-value widget)))
1899 1899
1900(defun custom-toggle-hide (widget) 1900(defun custom-toggle-hide (widget)
@@ -2074,11 +2074,25 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
2074 :group 'custom-buffer 2074 :group 'custom-buffer
2075 :version "20.3") 2075 :version "20.3")
2076 2076
2077(defun custom-variable-documentation (variable)
2078 "Return documentation of VARIABLE for use in Custom buffer.
2079Normally just return the docstring. But if VARIABLE automatically
2080becomes buffer local when set, append a message to that effect."
2081 (if (and (local-variable-if-set-p variable)
2082 (or (not (local-variable-p variable))
2083 (with-temp-buffer
2084 (local-variable-if-set-p variable))))
2085 (concat (documentation-property variable 'variable-documentation)
2086 "\n
2087This variable automatically becomes buffer-local when set outside Custom.
2088However, setting it through Custom sets the default value.")
2089 (documentation-property variable 'variable-documentation)))
2090
2077(define-widget 'custom-variable 'custom 2091(define-widget 'custom-variable 'custom
2078 "Customize variable." 2092 "Customize variable."
2079 :format "%v" 2093 :format "%v"
2080 :help-echo "Set or reset this variable." 2094 :help-echo "Set or reset this variable."
2081 :documentation-property 'variable-documentation 2095 :documentation-property #'custom-variable-documentation
2082 :custom-category 'option 2096 :custom-category 'option
2083 :custom-state nil 2097 :custom-state nil
2084 :custom-menu 'custom-variable-menu-create 2098 :custom-menu 'custom-variable-menu-create
@@ -2646,7 +2660,7 @@ Also change :reverse-video to :inverse-video."
2646 (widget-setup))))) 2660 (widget-setup)))))
2647 2661
2648(defun custom-face-edit-delete (widget) 2662(defun custom-face-edit-delete (widget)
2649 "Remove widget from the buffer." 2663 "Remove WIDGET from the buffer."
2650 (let ((inactive (widget-get widget :inactive)) 2664 (let ((inactive (widget-get widget :inactive))
2651 (inhibit-read-only t) 2665 (inhibit-read-only t)
2652 (inhibit-modification-hooks t)) 2666 (inhibit-modification-hooks t))
@@ -2729,6 +2743,10 @@ Match grayscale frames.")
2729Match frames with no color support.") 2743Match frames with no color support.")
2730 mono))) 2744 mono)))
2731 (group :sibling-args (:help-echo "\ 2745 (group :sibling-args (:help-echo "\
2746The minimum number of colors the frame should support.")
2747 (const :format "" min-colors)
2748 (integer :tag "Minimum number of colors" ))
2749 (group :sibling-args (:help-echo "\
2732Only match frames with the specified intensity.") 2750Only match frames with the specified intensity.")
2733 (const :format "\ 2751 (const :format "\
2734Background brightness: " 2752Background brightness: "
@@ -4023,6 +4041,7 @@ The format is suitable for use with `easy-menu-define'."
4023 (suppress-keymap custom-mode-map) 4041 (suppress-keymap custom-mode-map)
4024 (define-key custom-mode-map " " 'scroll-up) 4042 (define-key custom-mode-map " " 'scroll-up)
4025 (define-key custom-mode-map "\177" 'scroll-down) 4043 (define-key custom-mode-map "\177" 'scroll-down)
4044 (define-key custom-mode-map "\C-x\C-s" 'Custom-save)
4026 (define-key custom-mode-map "q" 'Custom-buffer-done) 4045 (define-key custom-mode-map "q" 'Custom-buffer-done)
4027 (define-key custom-mode-map "u" 'Custom-goto-parent) 4046 (define-key custom-mode-map "u" 'Custom-goto-parent)
4028 (define-key custom-mode-map "n" 'widget-forward) 4047 (define-key custom-mode-map "n" 'widget-forward)