diff options
| author | Artur Malabarba | 2015-10-25 11:24:40 +0000 |
|---|---|---|
| committer | Artur Malabarba | 2015-10-25 14:39:07 +0000 |
| commit | 2a85bf6a8e27dafd1005505a43cf9c4aff0957ea (patch) | |
| tree | f8727aebbb0548b0b0610e99e03eb1a0faf88553 | |
| parent | 551562513e304a38a0caa1b94d87cc39a1af7c18 (diff) | |
| download | emacs-2a85bf6a8e27dafd1005505a43cf9c4aff0957ea.tar.gz emacs-2a85bf6a8e27dafd1005505a43cf9c4aff0957ea.zip | |
* 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.
| -rw-r--r-- | lisp/custom.el | 15 |
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." | |||
| 155 | (unless (memq :group args) | 155 | (unless (memq :group args) |
| 156 | (custom-add-to-group (custom-current-group) symbol 'custom-variable)) | 156 | (custom-add-to-group (custom-current-group) symbol 'custom-variable)) |
| 157 | (while args | 157 | (while args |
| 158 | (let ((arg (car args))) | 158 | (let ((keyword (pop args))) |
| 159 | (setq args (cdr args)) | 159 | (unless (symbolp keyword) |
| 160 | (unless (symbolp arg) | ||
| 161 | (error "Junk in args %S" args)) | 160 | (error "Junk in args %S" args)) |
| 162 | (let ((keyword arg) | 161 | (unless args |
| 163 | (value (car args))) | 162 | (error "Keyword %s is missing an argument" keyword)) |
| 164 | (unless args | 163 | (let ((value (pop args))) |
| 165 | (error "Keyword %s is missing an argument" keyword)) | 164 | ;; Can't use `pcase' because it is loaded after `custom.el' |
| 166 | (setq args (cdr args)) | 165 | ;; during bootstrap. See `loadup.el'. |
| 167 | (cond ((eq keyword :initialize) | 166 | (cond ((eq keyword :initialize) |
| 168 | (setq initialize value)) | 167 | (setq initialize value)) |
| 169 | ((eq keyword :set) | 168 | ((eq keyword :set) |