diff options
Diffstat (limited to 'lisp/cus-edit.el')
| -rw-r--r-- | lisp/cus-edit.el | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index b50c1a5155b..176440f91bb 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages | 1 | ;;; cus-edit.el --- tools for customizing Emacs and Lisp packages -*- lexical-binding:t -*- |
| 2 | ;; | 2 | ;; |
| 3 | ;; Copyright (C) 1996-1997, 1999-2013 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1996-1997, 1999-2013 Free Software Foundation, Inc. |
| 4 | ;; | 4 | ;; |
| @@ -1057,8 +1057,8 @@ the resulting list value now. Otherwise, add an entry to | |||
| 1057 | (let ((coding-system-for-read nil)) | 1057 | (let ((coding-system-for-read nil)) |
| 1058 | (customize-save-variable list-var (eval list-var))) | 1058 | (customize-save-variable list-var (eval list-var))) |
| 1059 | (add-hook 'after-init-hook | 1059 | (add-hook 'after-init-hook |
| 1060 | `(lambda () | 1060 | (lambda () |
| 1061 | (customize-push-and-save ',list-var ',elts))))) | 1061 | (customize-push-and-save list-var elts))))) |
| 1062 | 1062 | ||
| 1063 | ;;;###autoload | 1063 | ;;;###autoload |
| 1064 | (defun customize () | 1064 | (defun customize () |
| @@ -1415,6 +1415,7 @@ suggest to customize that face, if it's customizable." | |||
| 1415 | "*Customize Saved*")))) | 1415 | "*Customize Saved*")))) |
| 1416 | 1416 | ||
| 1417 | (declare-function apropos-parse-pattern "apropos" (pattern)) | 1417 | (declare-function apropos-parse-pattern "apropos" (pattern)) |
| 1418 | (defvar apropos-regexp) | ||
| 1418 | 1419 | ||
| 1419 | ;;;###autoload | 1420 | ;;;###autoload |
| 1420 | (defun customize-apropos (pattern &optional type) | 1421 | (defun customize-apropos (pattern &optional type) |
| @@ -1431,23 +1432,23 @@ If TYPE is `groups', include only groups." | |||
| 1431 | (require 'apropos) | 1432 | (require 'apropos) |
| 1432 | (unless (memq type '(nil options faces groups)) | 1433 | (unless (memq type '(nil options faces groups)) |
| 1433 | (error "Invalid setting type %s" (symbol-name type))) | 1434 | (error "Invalid setting type %s" (symbol-name type))) |
| 1434 | (apropos-parse-pattern pattern) | 1435 | (apropos-parse-pattern pattern) ;Sets apropos-regexp by side-effect: Yuck! |
| 1435 | (let (found) | 1436 | (let (found) |
| 1436 | (mapatoms | 1437 | (mapatoms |
| 1437 | `(lambda (symbol) | 1438 | (lambda (symbol) |
| 1438 | (when (string-match-p apropos-regexp (symbol-name symbol)) | 1439 | (when (string-match-p apropos-regexp (symbol-name symbol)) |
| 1439 | ,(if (memq type '(nil groups)) | 1440 | (if (memq type '(nil groups)) |
| 1440 | '(if (get symbol 'custom-group) | 1441 | (if (get symbol 'custom-group) |
| 1441 | (push (list symbol 'custom-group) found))) | 1442 | (push (list symbol 'custom-group) found))) |
| 1442 | ,(if (memq type '(nil faces)) | 1443 | (if (memq type '(nil faces)) |
| 1443 | '(if (custom-facep symbol) | 1444 | (if (custom-facep symbol) |
| 1444 | (push (list symbol 'custom-face) found))) | 1445 | (push (list symbol 'custom-face) found))) |
| 1445 | ,(if (memq type '(nil options)) | 1446 | (if (memq type '(nil options)) |
| 1446 | `(if (and (boundp symbol) | 1447 | (if (and (boundp symbol) |
| 1447 | (eq (indirect-variable symbol) symbol) | 1448 | (eq (indirect-variable symbol) symbol) |
| 1448 | (or (get symbol 'saved-value) | 1449 | (or (get symbol 'saved-value) |
| 1449 | (custom-variable-p symbol))) | 1450 | (custom-variable-p symbol))) |
| 1450 | (push (list symbol 'custom-variable) found)))))) | 1451 | (push (list symbol 'custom-variable) found)))))) |
| 1451 | (unless found | 1452 | (unless found |
| 1452 | (error "No customizable %s matching %s" (symbol-name type) pattern)) | 1453 | (error "No customizable %s matching %s" (symbol-name type) pattern)) |
| 1453 | (custom-buffer-create | 1454 | (custom-buffer-create |
| @@ -1621,8 +1622,8 @@ or a regular expression.") | |||
| 1621 | (widget-create | 1622 | (widget-create |
| 1622 | 'editable-field | 1623 | 'editable-field |
| 1623 | :size 40 :help-echo echo | 1624 | :size 40 :help-echo echo |
| 1624 | :action `(lambda (widget &optional event) | 1625 | :action (lambda (widget &optional _event) |
| 1625 | (customize-apropos (split-string (widget-value widget))))))) | 1626 | (customize-apropos (split-string (widget-value widget))))))) |
| 1626 | (widget-insert " ") | 1627 | (widget-insert " ") |
| 1627 | (widget-create-child-and-convert | 1628 | (widget-create-child-and-convert |
| 1628 | search-widget 'push-button | 1629 | search-widget 'push-button |