comparison lisp/custom.el @ 48476:29e63846608d

(custom-declare-variable): Use push. Use the (defvar . <sym>) format in load-history like `defvar' does.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 20 Nov 2002 14:35:54 +0000
parents 89f1b9ff174d
children d886606b4f3a
comparison
equal deleted inserted replaced
48475:4bdcb09d9f25 48476:29e63846608d
139 ((eq keyword :set) 139 ((eq keyword :set)
140 (put symbol 'custom-set value)) 140 (put symbol 'custom-set value))
141 ((eq keyword :get) 141 ((eq keyword :get)
142 (put symbol 'custom-get value)) 142 (put symbol 'custom-get value))
143 ((eq keyword :require) 143 ((eq keyword :require)
144 (setq requests (cons value requests))) 144 (push value requests))
145 ((eq keyword :type) 145 ((eq keyword :type)
146 (put symbol 'custom-type (purecopy value))) 146 (put symbol 'custom-type (purecopy value)))
147 ((eq keyword :options) 147 ((eq keyword :options)
148 (if (get symbol 'custom-options) 148 (if (get symbol 'custom-options)
149 ;; Slow safe code to avoid duplicates. 149 ;; Slow safe code to avoid duplicates.
150 (mapc (lambda (option) 150 (mapc (lambda (option)
151 (custom-add-option symbol option)) 151 (custom-add-option symbol option))
152 value) 152 value)
153 ;; Fast code for the common case. 153 ;; Fast code for the common case.
154 (put symbol 'custom-options (copy-sequence value)))) 154 (put symbol 'custom-options (copy-sequence value))))
155 (t 155 (t
156 (custom-handle-keyword symbol keyword value 156 (custom-handle-keyword symbol keyword value
157 'custom-variable)))))) 157 'custom-variable))))))
158 (put symbol 'custom-requests requests) 158 (put symbol 'custom-requests requests)
159 ;; Do the actual initialization. 159 ;; Do the actual initialization.
160 (unless custom-dont-initialize 160 (unless custom-dont-initialize
161 (funcall initialize symbol default))) 161 (funcall initialize symbol default)))
162 (setq current-load-list (cons symbol current-load-list)) 162 (push (cons 'defvar symbol) current-load-list)
163 (run-hooks 'custom-define-hook) 163 (run-hooks 'custom-define-hook)
164 symbol) 164 symbol)
165 165
166 (defmacro defcustom (symbol value doc &rest args) 166 (defmacro defcustom (symbol value doc &rest args)
167 "Declare SYMBOL as a customizable variable that defaults to VALUE. 167 "Declare SYMBOL as a customizable variable that defaults to VALUE.