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.el76
1 files changed, 38 insertions, 38 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 203043ebd97..f14c055d7a8 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -792,7 +792,7 @@ and `yes-or-no-p' otherwise."
792 (message "Aborted") 792 (message "Aborted")
793 nil)) 793 nil))
794 794
795(defun Custom-set (&rest ignore) 795(defun Custom-set (&rest _ignore)
796 "Set the current value of all edited settings in the buffer." 796 "Set the current value of all edited settings in the buffer."
797 (interactive) 797 (interactive)
798 (custom-command-apply 798 (custom-command-apply
@@ -801,7 +801,7 @@ and `yes-or-no-p' otherwise."
801 (widget-apply child :custom-set))) 801 (widget-apply child :custom-set)))
802 "Set all values according to this buffer? ")) 802 "Set all values according to this buffer? "))
803 803
804(defun Custom-save (&rest ignore) 804(defun Custom-save (&rest _ignore)
805 "Set all edited settings, then save all settings that have been set. 805 "Set all edited settings, then save all settings that have been set.
806If a setting was edited and set before, this saves it. If a 806If a setting was edited and set before, this saves it. If a
807setting was merely edited before, this sets it then saves it." 807setting was merely edited before, this sets it then saves it."
@@ -817,7 +817,7 @@ setting was merely edited before, this sets it then saves it."
817 (dolist (child custom-options) 817 (dolist (child custom-options)
818 (widget-apply child :custom-state-set-and-redraw)))) 818 (widget-apply child :custom-state-set-and-redraw))))
819 819
820(defun custom-reset (widget &optional event) 820(defun custom-reset (_widget &optional event)
821 "Select item from reset menu." 821 "Select item from reset menu."
822 (let* ((completion-ignore-case t) 822 (let* ((completion-ignore-case t)
823 (answer (widget-choose "Reset settings" 823 (answer (widget-choose "Reset settings"
@@ -826,7 +826,7 @@ setting was merely edited before, this sets it then saves it."
826 (if answer 826 (if answer
827 (funcall answer)))) 827 (funcall answer))))
828 828
829(defun Custom-reset-current (&rest ignore) 829(defun Custom-reset-current (&rest _ignore)
830 "Reset all edited settings in the buffer to show their current values." 830 "Reset all edited settings in the buffer to show their current values."
831 (interactive) 831 (interactive)
832 (custom-command-apply 832 (custom-command-apply
@@ -835,7 +835,7 @@ setting was merely edited before, this sets it then saves it."
835 (widget-apply widget :custom-reset-current))) 835 (widget-apply widget :custom-reset-current)))
836 "Reset all settings' buffer text to show current values? ")) 836 "Reset all settings' buffer text to show current values? "))
837 837
838(defun Custom-reset-saved (&rest ignore) 838(defun Custom-reset-saved (&rest _ignore)
839 "Reset all edited or set settings in the buffer to their saved value. 839 "Reset all edited or set settings in the buffer to their saved value.
840This also shows the saved values in the buffer." 840This also shows the saved values in the buffer."
841 (interactive) 841 (interactive)
@@ -876,7 +876,6 @@ This also shows the saved values in the buffer."
876 (unless (eq widget t) 876 (unless (eq widget t)
877 (let* ((symbol (widget-value widget)) 877 (let* ((symbol (widget-value widget))
878 (child (car (widget-get widget :children))) 878 (child (car (widget-get widget :children)))
879 (value (get symbol 'face-defface-spec))
880 (comment-widget (widget-get widget :comment-widget))) 879 (comment-widget (widget-get widget :comment-widget)))
881 (put symbol 'face-comment nil) 880 (put symbol 'face-comment nil)
882 (widget-value-set child 881 (widget-value-set child
@@ -888,7 +887,7 @@ This also shows the saved values in the buffer."
888 (custom-face-state-set widget) 887 (custom-face-state-set widget)
889 (custom-redraw-magic widget)))))) 888 (custom-redraw-magic widget))))))
890 889
891(defun Custom-reset-standard (&rest ignore) 890(defun Custom-reset-standard (&rest _ignore)
892 "Erase all customizations (either current or saved) in current buffer. 891 "Erase all customizations (either current or saved) in current buffer.
893The immediate result is to restore them to their standard values. 892The immediate result is to restore them to their standard values.
894This operation eliminates any saved values for the group members, 893This operation eliminates any saved values for the group members,
@@ -920,7 +919,7 @@ it were the arg to `interactive' (which see) to interactively read the value.
920 919
921If the variable has a `custom-type' property, it must be a widget and the 920If the variable has a `custom-type' property, it must be a widget and the
922`:prompt-value' property of that widget will be used for reading the value. 921`:prompt-value' property of that widget will be used for reading the value.
923If the variable also has a `custom-get' property, that is used for finding 922If the variable also has a `custom-get' property, that is used for finding
924the current value of the variable, otherwise `symbol-value' is used. 923the current value of the variable, otherwise `symbol-value' is used.
925 924
926If optional COMMENT argument is non-nil, also prompt for a comment and return 925If optional COMMENT argument is non-nil, also prompt for a comment and return
@@ -943,8 +942,8 @@ it as the third element in the list."
943 (widget-prompt-value type 942 (widget-prompt-value type
944 prompt 943 prompt
945 (if (boundp var) 944 (if (boundp var)
946 (funcall 945 (funcall
947 (or (get var 'custom-get) 'symbol-value) 946 (or (get var 'custom-get) 'symbol-value)
948 var)) 947 var))
949 (not (boundp var)))) 948 (not (boundp var))))
950 (t 949 (t
@@ -1401,7 +1400,7 @@ that are not customizable options, as well as faces and groups
1401 (interactive (list (apropos-read-pattern "symbol") current-prefix-arg)) 1400 (interactive (list (apropos-read-pattern "symbol") current-prefix-arg))
1402 (require 'apropos) 1401 (require 'apropos)
1403 (apropos-parse-pattern pattern) 1402 (apropos-parse-pattern pattern)
1404 (let (found tests) 1403 (let (found)
1405 (mapatoms 1404 (mapatoms
1406 `(lambda (symbol) 1405 `(lambda (symbol)
1407 (when (string-match apropos-regexp (symbol-name symbol)) 1406 (when (string-match apropos-regexp (symbol-name symbol))
@@ -1536,7 +1535,7 @@ This button will have a menu with all three reset operations."
1536 :type 'boolean 1535 :type 'boolean
1537 :group 'custom-buffer) 1536 :group 'custom-buffer)
1538 1537
1539(defun Custom-buffer-done (&rest ignore) 1538(defun Custom-buffer-done (&rest _ignore)
1540 "Exit current Custom buffer according to `custom-buffer-done-kill'." 1539 "Exit current Custom buffer according to `custom-buffer-done-kill'."
1541 (interactive) 1540 (interactive)
1542 (quit-window custom-buffer-done-kill)) 1541 (quit-window custom-buffer-done-kill))
@@ -1574,7 +1573,7 @@ Otherwise use brackets."
1574 'custom-button-pressed 1573 'custom-button-pressed
1575 'custom-button-pressed-unraised)))) 1574 'custom-button-pressed-unraised))))
1576 1575
1577(defun custom-buffer-create-internal (options &optional description) 1576(defun custom-buffer-create-internal (options &optional _description)
1578 (Custom-mode) 1577 (Custom-mode)
1579 (let ((init-file (or custom-file user-init-file))) 1578 (let ((init-file (or custom-file user-init-file)))
1580 ;; Insert verbose help at the top of the custom buffer. 1579 ;; Insert verbose help at the top of the custom buffer.
@@ -1609,7 +1608,7 @@ Otherwise use brackets."
1609 search-widget 'push-button 1608 search-widget 'push-button
1610 :tag " Search " 1609 :tag " Search "
1611 :help-echo echo :action 1610 :help-echo echo :action
1612 (lambda (widget &optional event) 1611 (lambda (widget &optional _event)
1613 (customize-apropos (widget-value (widget-get widget :parent))))) 1612 (customize-apropos (widget-value (widget-get widget :parent)))))
1614 (widget-insert "\n"))) 1613 (widget-insert "\n")))
1615 1614
@@ -1623,7 +1622,7 @@ Otherwise use brackets."
1623 (if custom-buffer-verbose-help 1622 (if custom-buffer-verbose-help
1624 (widget-insert " 1623 (widget-insert "
1625 Operate on all settings in this buffer:\n")) 1624 Operate on all settings in this buffer:\n"))
1626 (let ((button (lambda (tag action active help icon label) 1625 (let ((button (lambda (tag action active help _icon _label)
1627 (widget-insert " ") 1626 (widget-insert " ")
1628 (if (eval active) 1627 (if (eval active)
1629 (widget-create 'push-button :tag tag 1628 (widget-create 'push-button :tag tag
@@ -1743,7 +1742,7 @@ item in another window.\n\n"))
1743 :format "%[[%t]%]" 1742 :format "%[[%t]%]"
1744 :action 'custom-browse-visibility-action) 1743 :action 'custom-browse-visibility-action)
1745 1744
1746(defun custom-browse-visibility-action (widget &rest ignore) 1745(defun custom-browse-visibility-action (widget &rest _ignore)
1747 (let ((custom-buffer-style 'tree)) 1746 (let ((custom-buffer-style 'tree))
1748 (custom-toggle-parent widget))) 1747 (custom-toggle-parent widget)))
1749 1748
@@ -1753,7 +1752,7 @@ item in another window.\n\n"))
1753 :tag-glyph "folder" 1752 :tag-glyph "folder"
1754 :action 'custom-browse-group-tag-action) 1753 :action 'custom-browse-group-tag-action)
1755 1754
1756(defun custom-browse-group-tag-action (widget &rest ignore) 1755(defun custom-browse-group-tag-action (widget &rest _ignore)
1757 (let ((parent (widget-get widget :parent))) 1756 (let ((parent (widget-get widget :parent)))
1758 (customize-group-other-window (widget-value parent)))) 1757 (customize-group-other-window (widget-value parent))))
1759 1758
@@ -1763,7 +1762,7 @@ item in another window.\n\n"))
1763 :tag-glyph "option" 1762 :tag-glyph "option"
1764 :action 'custom-browse-variable-tag-action) 1763 :action 'custom-browse-variable-tag-action)
1765 1764
1766(defun custom-browse-variable-tag-action (widget &rest ignore) 1765(defun custom-browse-variable-tag-action (widget &rest _ignore)
1767 (let ((parent (widget-get widget :parent))) 1766 (let ((parent (widget-get widget :parent)))
1768 (customize-variable-other-window (widget-value parent)))) 1767 (customize-variable-other-window (widget-value parent))))
1769 1768
@@ -1773,7 +1772,7 @@ item in another window.\n\n"))
1773 :tag-glyph "face" 1772 :tag-glyph "face"
1774 :action 'custom-browse-face-tag-action) 1773 :action 'custom-browse-face-tag-action)
1775 1774
1776(defun custom-browse-face-tag-action (widget &rest ignore) 1775(defun custom-browse-face-tag-action (widget &rest _ignore)
1777 (let ((parent (widget-get widget :parent))) 1776 (let ((parent (widget-get widget :parent)))
1778 (customize-face-other-window (widget-value parent)))) 1777 (customize-face-other-window (widget-value parent))))
1779 1778
@@ -1809,7 +1808,7 @@ item in another window.\n\n"))
1809 1808
1810(widget-put (get 'item 'widget-type) :custom-show t) 1809(widget-put (get 'item 'widget-type) :custom-show t)
1811(widget-put (get 'editable-field 'widget-type) 1810(widget-put (get 'editable-field 'widget-type)
1812 :custom-show (lambda (widget value) 1811 :custom-show (lambda (_widget value)
1813 (let ((pp (pp-to-string value))) 1812 (let ((pp (pp-to-string value)))
1814 (cond ((string-match "\n" pp) 1813 (cond ((string-match "\n" pp)
1815 nil) 1814 nil)
@@ -1998,7 +1997,7 @@ and `face'."
1998 :value-create 'custom-magic-value-create 1997 :value-create 'custom-magic-value-create
1999 :value-delete 'widget-children-value-delete) 1998 :value-delete 'widget-children-value-delete)
2000 1999
2001(defun widget-magic-mouse-down-action (widget &optional event) 2000(defun widget-magic-mouse-down-action (widget &optional _event)
2002 ;; Non-nil unless hidden. 2001 ;; Non-nil unless hidden.
2003 (not (eq (widget-get (widget-get (widget-get widget :parent) :parent) 2002 (not (eq (widget-get (widget-get (widget-get widget :parent) :parent)
2004 :custom-state) 2003 :custom-state)
@@ -2182,7 +2181,7 @@ and `face'."
2182 :value-delete 'widget-children-value-delete 2181 :value-delete 'widget-children-value-delete
2183 :value-get 'widget-value-value-get 2182 :value-get 'widget-value-value-get
2184 :validate 'widget-children-validate 2183 :validate 'widget-children-validate
2185 :match (lambda (widget value) (symbolp value))) 2184 :match (lambda (_widget value) (symbolp value)))
2186 2185
2187(defun custom-convert-widget (widget) 2186(defun custom-convert-widget (widget)
2188 "Initialize :value and :tag from :args in WIDGET." 2187 "Initialize :value and :tag from :args in WIDGET."
@@ -2282,7 +2281,7 @@ and `face'."
2282 (custom-redraw widget) 2281 (custom-redraw widget)
2283 (widget-setup))) 2282 (widget-setup)))
2284 2283
2285(defun custom-toggle-parent (widget &rest ignore) 2284(defun custom-toggle-parent (widget &rest _ignore)
2286 "Toggle visibility of parent of WIDGET." 2285 "Toggle visibility of parent of WIDGET."
2287 (custom-toggle-hide (widget-get widget :parent))) 2286 (custom-toggle-hide (widget-get widget :parent)))
2288 2287
@@ -2318,7 +2317,7 @@ Insert PREFIX first if non-nil."
2318 (insert ", ")))) 2317 (insert ", "))))
2319 (widget-put widget :buttons buttons)))) 2318 (widget-put widget :buttons buttons))))
2320 2319
2321(defun custom-add-parent-links (widget &optional initial-string doc-initial-string) 2320(defun custom-add-parent-links (widget &optional initial-string _doc-initial-string)
2322 "Add \"Parent groups: ...\" to WIDGET if the group has parents. 2321 "Add \"Parent groups: ...\" to WIDGET if the group has parents.
2323The value is non-nil if any parents were found. 2322The value is non-nil if any parents were found.
2324If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." 2323If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
@@ -2675,7 +2674,7 @@ try matching its doc string against `custom-guess-doc-alist'."
2675 (custom-add-parent-links widget)) 2674 (custom-add-parent-links widget))
2676 (custom-add-see-also widget))))) 2675 (custom-add-see-also widget)))))
2677 2676
2678(defun custom-toggle-hide-variable (visibility-widget &rest ignore) 2677(defun custom-toggle-hide-variable (visibility-widget &rest _ignore)
2679 "Toggle the visibility of a `custom-variable' parent widget. 2678 "Toggle the visibility of a `custom-variable' parent widget.
2680By default, this signals an error if the parent has unsaved 2679By default, this signals an error if the parent has unsaved
2681changes. If the parent has a `simple' :custom-style property, 2680changes. If the parent has a `simple' :custom-style property,
@@ -3132,14 +3131,14 @@ face attributes (as specified by a `default' defface entry)."
3132 (widget-put widget :buttons buttons) 3131 (widget-put widget :buttons buttons)
3133 (widget-put widget :children (nreverse (widget-get widget :children))))) 3132 (widget-put widget :children (nreverse (widget-get widget :children)))))
3134 3133
3135(defun custom-face-edit-value-visibility-action (widget &rest ignore) 3134(defun custom-face-edit-value-visibility-action (widget &rest _ignore)
3136 ;; Toggle hiding of face attributes. 3135 ;; Toggle hiding of face attributes.
3137 (let ((parent (widget-get widget :parent))) 3136 (let ((parent (widget-get widget :parent)))
3138 (widget-put parent :show-all-attributes 3137 (widget-put parent :show-all-attributes
3139 (not (widget-get parent :show-all-attributes))) 3138 (not (widget-get parent :show-all-attributes)))
3140 (custom-redraw parent))) 3139 (custom-redraw parent)))
3141 3140
3142(defun custom-face-edit-fix-value (widget value) 3141(defun custom-face-edit-fix-value (_widget value)
3143 "Ignoring WIDGET, convert :bold and :italic in VALUE to new form. 3142 "Ignoring WIDGET, convert :bold and :italic in VALUE to new form.
3144Also change :reverse-video to :inverse-video." 3143Also change :reverse-video to :inverse-video."
3145 (custom-fix-face-spec value)) 3144 (custom-fix-face-spec value))
@@ -3426,7 +3425,7 @@ WIDGET should be a `custom-face' widget."
3426 (setq spec `((t ,(face-attr-construct face (selected-frame)))))) 3425 (setq spec `((t ,(face-attr-construct face (selected-frame))))))
3427 (custom-pre-filter-face-spec spec))) 3426 (custom-pre-filter-face-spec spec)))
3428 3427
3429(defun custom-toggle-hide-face (visibility-widget &rest ignore) 3428(defun custom-toggle-hide-face (visibility-widget &rest _ignore)
3430 "Toggle the visibility of a `custom-face' parent widget. 3429 "Toggle the visibility of a `custom-face' parent widget.
3431By default, this signals an error if the parent has unsaved 3430By default, this signals an error if the parent has unsaved
3432changes. If the parent has a `simple' :custom-style property, 3431changes. If the parent has a `simple' :custom-style property,
@@ -3830,7 +3829,7 @@ restoring it to the state of a face that has never been customized."
3830 :value 'default 3829 :value 'default
3831 :sample-face-get 'widget-face-sample-face-get 3830 :sample-face-get 'widget-face-sample-face-get
3832 :notify 'widget-face-notify 3831 :notify 'widget-face-notify
3833 :match (lambda (widget value) (facep value)) 3832 :match (lambda (_widget value) (facep value))
3834 :complete-function (lambda () 3833 :complete-function (lambda ()
3835 (interactive) 3834 (interactive)
3836 (lisp-complete-symbol 'facep)) 3835 (lisp-complete-symbol 'facep))
@@ -3860,7 +3859,7 @@ restoring it to the state of a face that has never been customized."
3860 3859
3861(define-widget 'hook 'list 3860(define-widget 'hook 'list
3862 "An Emacs Lisp hook." 3861 "An Emacs Lisp hook."
3863 :value-to-internal (lambda (widget value) 3862 :value-to-internal (lambda (_widget value)
3864 (if (and value (symbolp value)) 3863 (if (and value (symbolp value))
3865 (list value) 3864 (list value)
3866 value)) 3865 value))
@@ -3905,7 +3904,7 @@ restoring it to the state of a face that has never been customized."
3905 :follow-link 'mouse-face 3904 :follow-link 'mouse-face
3906 :action 'custom-group-link-action) 3905 :action 'custom-group-link-action)
3907 3906
3908(defun custom-group-link-action (widget &rest ignore) 3907(defun custom-group-link-action (widget &rest _ignore)
3909 (customize-group (widget-value widget))) 3908 (customize-group (widget-value widget)))
3910 3909
3911;;; The `custom-group' Widget. 3910;;; The `custom-group' Widget.
@@ -4202,8 +4201,7 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
4202 (widget-insert "\n") 4201 (widget-insert "\n")
4203 (progress-reporter-update reporter (setq count (1+ count))) 4202 (progress-reporter-update reporter (setq count (1+ count)))
4204 (let ((sym (nth 0 entry)) 4203 (let ((sym (nth 0 entry))
4205 (type (nth 1 entry)) 4204 (type (nth 1 entry)))
4206 hidden-p)
4207 (prog1 4205 (prog1
4208 (widget-create-child-and-convert 4206 (widget-create-child-and-convert
4209 widget type 4207 widget type
@@ -4510,6 +4508,8 @@ This function does not save the buffer."
4510 (setq pos (line-beginning-position)))) 4508 (setq pos (line-beginning-position))))
4511 (goto-char pos))))) 4509 (goto-char pos)))))
4512 4510
4511(defvar sort-fold-case) ; defined in sort.el
4512
4513(defun custom-save-variables () 4513(defun custom-save-variables ()
4514 "Save all customized variables in `custom-file'." 4514 "Save all customized variables in `custom-file'."
4515 (save-excursion 4515 (save-excursion
@@ -4648,13 +4648,13 @@ This function does not save the buffer."
4648 :type 'integer 4648 :type 'integer
4649 :group 'custom-menu) 4649 :group 'custom-menu)
4650 4650
4651(defun custom-face-menu-create (widget symbol) 4651(defun custom-face-menu-create (_widget symbol)
4652 "Ignoring WIDGET, create a menu entry for customization face SYMBOL." 4652 "Ignoring WIDGET, create a menu entry for customization face SYMBOL."
4653 (vector (custom-unlispify-menu-entry symbol) 4653 (vector (custom-unlispify-menu-entry symbol)
4654 `(customize-face ',symbol) 4654 `(customize-face ',symbol)
4655 t)) 4655 t))
4656 4656
4657(defun custom-variable-menu-create (widget symbol) 4657(defun custom-variable-menu-create (_widget symbol)
4658 "Ignoring WIDGET, create a menu entry for customization variable SYMBOL." 4658 "Ignoring WIDGET, create a menu entry for customization variable SYMBOL."
4659 (let ((type (get symbol 'custom-type))) 4659 (let ((type (get symbol 'custom-type)))
4660 (unless (listp type) 4660 (unless (listp type)
@@ -4667,13 +4667,13 @@ This function does not save the buffer."
4667 4667
4668;; Add checkboxes to boolean variable entries. 4668;; Add checkboxes to boolean variable entries.
4669(widget-put (get 'boolean 'widget-type) 4669(widget-put (get 'boolean 'widget-type)
4670 :custom-menu (lambda (widget symbol) 4670 :custom-menu (lambda (_widget symbol)
4671 (vector (custom-unlispify-menu-entry symbol) 4671 (vector (custom-unlispify-menu-entry symbol)
4672 `(customize-variable ',symbol) 4672 `(customize-variable ',symbol)
4673 ':style 'toggle 4673 ':style 'toggle
4674 ':selected symbol))) 4674 ':selected symbol)))
4675 4675
4676(defun custom-group-menu-create (widget symbol) 4676(defun custom-group-menu-create (_widget symbol)
4677 "Ignoring WIDGET, create a menu entry for customization group SYMBOL." 4677 "Ignoring WIDGET, create a menu entry for customization group SYMBOL."
4678 `( ,(custom-unlispify-menu-entry symbol t) 4678 `( ,(custom-unlispify-menu-entry symbol t)
4679 :filter (lambda (&rest junk) 4679 :filter (lambda (&rest junk)
@@ -4747,7 +4747,7 @@ The format is suitable for use with `easy-menu-define'."
4747 4747
4748;;; The Custom Mode. 4748;;; The Custom Mode.
4749 4749
4750(defun Custom-no-edit (pos &optional event) 4750(defun Custom-no-edit (_pos &optional _event)
4751 "Invoke button at POS, or refuse to allow editing of Custom buffer." 4751 "Invoke button at POS, or refuse to allow editing of Custom buffer."
4752 (interactive "@d") 4752 (interactive "@d")
4753 (error "You can't edit this part of the Custom buffer")) 4753 (error "You can't edit this part of the Custom buffer"))