summaryrefslogtreecommitdiff
path: root/lisp/custom.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-10-25 11:24:40 +0000
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-10-25 14:39:07 +0000
commit2a85bf6a8e27dafd1005505a43cf9c4aff0957ea (patch)
treef8727aebbb0548b0b0610e99e03eb1a0faf88553 /lisp/custom.el
parent551562513e304a38a0caa1b94d87cc39a1af7c18 (diff)
downloademacs-2a85bf6a8e27dafd1005505a43cf9c4aff0957ea.tar.gz
* 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.
Diffstat (limited to 'lisp/custom.el')
-rw-r--r--lisp/custom.el15
1 files changed, 7 insertions, 8 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index c5d0e65f42b..afff8674f34 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -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)