]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/custom.el (custom-declare-variable): Shorten code again
authorArtur Malabarba <bruce.connor.am@gmail.com>
Sun, 25 Oct 2015 11:24:40 +0000 (11:24 +0000)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Sun, 25 Oct 2015 14:39:07 +0000 (14:39 +0000)
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.

lisp/custom.el

index c5d0e65f42bfad340557fde71ba824821bd600be..afff8674f3414dea83ff48ad73e3b272b5155206 100644 (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)