1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

* lisp/custom.el (custom-declare-variable): Shorten code again

Without using pcase this time.  We can't use pcase because it is loaded
after custom in loadup.el.  Also add a comment explaining this to future
dummies like me.
This commit is contained in:
Artur Malabarba 2015-10-25 11:24:40 +00:00
parent 551562513e
commit 2a85bf6a8e

View file

@ -155,15 +155,14 @@ set to nil, as the value is no longer rogue."
(unless (memq :group args)
(custom-add-to-group (custom-current-group) symbol 'custom-variable))
(while args
(let ((arg (car args)))
(setq args (cdr args))
(unless (symbolp arg)
(let ((keyword (pop args)))
(unless (symbolp keyword)
(error "Junk in args %S" args))
(let ((keyword arg)
(value (car args)))
(unless args
(error "Keyword %s is missing an argument" keyword))
(setq args (cdr args))
(unless args
(error "Keyword %s is missing an argument" keyword))
(let ((value (pop args)))
;; Can't use `pcase' because it is loaded after `custom.el'
;; during bootstrap. See `loadup.el'.
(cond ((eq keyword :initialize)
(setq initialize value))
((eq keyword :set)