(custom-buffer-create-internal): Save some consing.

(custom-variable-set): Improve validation error mesage.
This commit is contained in:
Dave Love 2000-11-22 17:52:24 +00:00
parent 197615f33f
commit 6b29231253

View file

@ -1297,14 +1297,13 @@ Un-customize all values in this buffer. They get their standard settings."
:tag "Finish" :tag "Finish"
:help-echo :help-echo
(lambda (&rest ignore) (lambda (&rest ignore)
(concat (cond (cond
((eq custom-buffer-done-function ((eq custom-buffer-done-function
'custom-bury-buffer) 'custom-bury-buffer)
"Bury") "Bury this buffer")
((eq custom-buffer-done-function 'kill-buffer) ((eq custom-buffer-done-function 'kill-buffer)
"Kill") "Kill this buffer")
(t "Finish with")) (t "Finish with this buffer")))
" the buffer."))
:action #'Custom-buffer-done) :action #'Custom-buffer-done)
(widget-insert "\n\n") (widget-insert "\n\n")
(message "Creating customization items...") (message "Creating customization items...")
@ -1322,18 +1321,18 @@ Un-customize all values in this buffer. They get their standard settings."
(let ((count 0) (let ((count 0)
(length (length options))) (length (length options)))
(mapcar (lambda (entry) (mapcar (lambda (entry)
(prog2 (prog2
(message "Creating customization items ...%2d%%" (message "Creating customization items ...%2d%%"
(/ (* 100.0 count) length)) (/ (* 100.0 count) length))
(widget-create (nth 1 entry) (widget-create (nth 1 entry)
:tag (custom-unlispify-tag-name :tag (custom-unlispify-tag-name
(nth 0 entry)) (nth 0 entry))
:value (nth 0 entry)) :value (nth 0 entry))
(setq count (1+ count)) (setq count (1+ count))
(unless (eq (preceding-char) ?\n) (unless (eq (preceding-char) ?\n)
(widget-insert "\n")) (widget-insert "\n"))
(widget-insert "\n"))) (widget-insert "\n")))
options)))) options))))
(unless (eq (preceding-char) ?\n) (unless (eq (preceding-char) ?\n)
(widget-insert "\n")) (widget-insert "\n"))
(message "Creating customization items ...%2d%%done" 100) (message "Creating customization items ...%2d%%done" 100)
@ -2379,7 +2378,7 @@ Optional EVENT is the location for the menu."
(error "Cannot set hidden variable")) (error "Cannot set hidden variable"))
((setq val (widget-apply child :validate)) ((setq val (widget-apply child :validate))
(goto-char (widget-get val :from)) (goto-char (widget-get val :from))
(error "%s" (widget-get val :error))) (error "Saving %s: %s" symbol (widget-get val :error)))
((memq form '(lisp mismatch)) ((memq form '(lisp mismatch))
(when (equal comment "") (when (equal comment "")
(setq comment nil) (setq comment nil)