diff options
| author | Paul Eggert | 2015-10-25 00:29:42 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-10-25 00:30:16 -0700 |
| commit | 0afbc5b2a2cda9fe12246bf62567162ae2577160 (patch) | |
| tree | aaf0330eae424e8fd40a7bd559de9960ef8bf460 | |
| parent | d8589ad4e3cf2ed6759836f28081d96748360915 (diff) | |
| download | emacs-0afbc5b2a2cda9fe12246bf62567162ae2577160.tar.gz emacs-0afbc5b2a2cda9fe12246bf62567162ae2577160.zip | |
Revert commit that broke 'make bootstrap'
* lisp/custom.el (custom-declare-variable): Revert commit
79fac080d277fed07b3c192890ad59d36d9f83b6. custom.el needs to work
even when pcase has not been defined yet, when doing bootstrapping.
| -rw-r--r-- | lisp/custom.el | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/lisp/custom.el b/lisp/custom.el index cc284ef51ce..c5d0e65f42b 100644 --- a/lisp/custom.el +++ b/lisp/custom.el | |||
| @@ -155,29 +155,40 @@ 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 ((keyword (pop args))) | 158 | (let ((arg (car args))) |
| 159 | (unless (symbolp keyword) | 159 | (setq args (cdr args)) |
| 160 | (error "Junk in args %S" (cons keyword args))) | 160 | (unless (symbolp arg) |
| 161 | (unless args | 161 | (error "Junk in args %S" args)) |
| 162 | (error "Keyword %s is missing an argument" keyword)) | 162 | (let ((keyword arg) |
| 163 | (let ((value (pop args))) | 163 | (value (car args))) |
| 164 | (pcase keyword | 164 | (unless args |
| 165 | (`:initialize (setq initialize value)) | 165 | (error "Keyword %s is missing an argument" keyword)) |
| 166 | (`:set (put symbol 'custom-set value)) | 166 | (setq args (cdr args)) |
| 167 | (`:get (put symbol 'custom-get value)) | 167 | (cond ((eq keyword :initialize) |
| 168 | (`:require (push value requests)) | 168 | (setq initialize value)) |
| 169 | (`:risky (put symbol 'risky-local-variable value)) | 169 | ((eq keyword :set) |
| 170 | (`:safe (put symbol 'safe-local-variable value)) | 170 | (put symbol 'custom-set value)) |
| 171 | (`:type (put symbol 'custom-type (purecopy value))) | 171 | ((eq keyword :get) |
| 172 | (`:options (if (get symbol 'custom-options) | 172 | (put symbol 'custom-get value)) |
| 173 | ;; Slow safe code to avoid duplicates. | 173 | ((eq keyword :require) |
| 174 | (mapc (lambda (option) | 174 | (push value requests)) |
| 175 | (custom-add-option symbol option)) | 175 | ((eq keyword :risky) |
| 176 | value) | 176 | (put symbol 'risky-local-variable value)) |
| 177 | ;; Fast code for the common case. | 177 | ((eq keyword :safe) |
| 178 | (put symbol 'custom-options (copy-sequence value)))) | 178 | (put symbol 'safe-local-variable value)) |
| 179 | (_ (custom-handle-keyword symbol keyword value | 179 | ((eq keyword :type) |
| 180 | 'custom-variable)))))) | 180 | (put symbol 'custom-type (purecopy value))) |
| 181 | ((eq keyword :options) | ||
| 182 | (if (get symbol 'custom-options) | ||
| 183 | ;; Slow safe code to avoid duplicates. | ||
| 184 | (mapc (lambda (option) | ||
| 185 | (custom-add-option symbol option)) | ||
| 186 | value) | ||
| 187 | ;; Fast code for the common case. | ||
| 188 | (put symbol 'custom-options (copy-sequence value)))) | ||
| 189 | (t | ||
| 190 | (custom-handle-keyword symbol keyword value | ||
| 191 | 'custom-variable)))))) | ||
| 181 | (put symbol 'custom-requests requests) | 192 | (put symbol 'custom-requests requests) |
| 182 | ;; Do the actual initialization. | 193 | ;; Do the actual initialization. |
| 183 | (unless custom-dont-initialize | 194 | (unless custom-dont-initialize |