[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 2a85bf6 1/2: * lisp/custom.el (custom-declare-varia
From: |
Artur Malabarba |
Subject: |
[Emacs-diffs] master 2a85bf6 1/2: * lisp/custom.el (custom-declare-variable): Shorten code again |
Date: |
Sun, 25 Oct 2015 14:39:55 +0000 |
branch: master
commit 2a85bf6a8e27dafd1005505a43cf9c4aff0957ea
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
* 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.
---
lisp/custom.el | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/lisp/custom.el b/lisp/custom.el
index c5d0e65..afff867 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)