diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-01-05 17:57:15 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2021-01-05 17:57:15 -0500 |
commit | 7d7bfbf0346114b116e14a4338ea235d12674f13 (patch) | |
tree | 3faa31cbe70fbda6f6bc3e12480b771749fdd2e2 /lisp/custom.el | |
parent | 048b1aaec8d5cd4ce6e6a5a9b8091608d0af81a6 (diff) | |
download | emacs-7d7bfbf0346114b116e14a4338ea235d12674f13.tar.gz |
* lisp/emacs-lisp/autoload.el: Improve last change
It turns out there were other places that used `custom-initialize-delay`
on autoloaded variables and used various hacks to make it work with
`autoload.el`. The new code makes those hacks unneeded.
Also, there's no point trying to "optimize" those rare cases anyway,
so I simplified the `autoload.el` code for those cases.
(make-autoload): For non-trivial cases,
just include the whole `defcustom` instead of trying to mimic it.
* lisp/mail/rmail.el (rmail-spool-directory): Remove hacks.
* lisp/info.el (Info-default-directory-list): Remove `progn` hack.
* lisp/custom.el (custom-declare-variable)
(custom-handle-all-keywords): Don't use pseudo-group `nil`.
Diffstat (limited to 'lisp/custom.el')
-rw-r--r-- | lisp/custom.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/custom.el b/lisp/custom.el index dfa8539c44f..d9d0898dcb7 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -161,7 +161,9 @@ set to nil, as the value is no longer rogue." ;; Whether automatically buffer-local. buffer-local) (unless (memq :group args) - (custom-add-to-group (custom-current-group) symbol 'custom-variable)) + (let ((cg (custom-current-group))) + (when cg + (custom-add-to-group cg symbol 'custom-variable)))) (while args (let ((keyword (pop args))) (unless (symbolp keyword) @@ -525,7 +527,9 @@ If no such group is found, return nil." "For customization option SYMBOL, handle keyword arguments ARGS. Third argument TYPE is the custom option type." (unless (memq :group args) - (custom-add-to-group (custom-current-group) symbol type)) + (let ((cg (custom-current-group))) + (when cg + (custom-add-to-group cg symbol type)))) (while args (let ((arg (car args))) (setq args (cdr args)) |