comparison lisp/cus-edit.el @ 72588:97860dfadca5

(custom-save-variables): Slight cleanup. (Custom-no-edit): Renamed from custom-no-edit. (Custom-newline): Renamed from custom-newline. (custom-mode-map): Use new names.
author Richard M. Stallman <rms@gnu.org>
date Thu, 31 Aug 2006 23:16:03 +0000
parents 4130a8f38950
children b09d9bab1859
comparison
equal deleted inserted replaced
72587:e2ff121d30ca 72588:97860dfadca5
4253 ;; If there is more than one, they won't work right.\n") 4253 ;; If there is more than one, they won't work right.\n")
4254 (dolist (symbol saved-list) 4254 (dolist (symbol saved-list)
4255 (let ((spec (car-safe (get symbol 'theme-value))) 4255 (let ((spec (car-safe (get symbol 'theme-value)))
4256 (value (get symbol 'saved-value)) 4256 (value (get symbol 'saved-value))
4257 (requests (get symbol 'custom-requests)) 4257 (requests (get symbol 'custom-requests))
4258 (now (not (or (custom-variable-p symbol) 4258 (now (and (not (custom-variable-p symbol))
4259 (and (not (boundp symbol)) 4259 (or (boundp symbol)
4260 (not (eq (get symbol 'force-value) 4260 (eq (get symbol 'force-value)
4261 'rogue)))))) 4261 'rogue))))
4262 (comment (get symbol 'saved-variable-comment))) 4262 (comment (get symbol 'saved-variable-comment)))
4263 ;; Check `requests'. 4263 ;; Check REQUESTS for validity.
4264 (dolist (request requests) 4264 (dolist (request requests)
4265 (when (and (symbolp request) (not (featurep request))) 4265 (when (and (symbolp request) (not (featurep request)))
4266 (message "Unknown requested feature: %s" request) 4266 (message "Unknown requested feature: %s" request)
4267 (setq requests (delq request requests)))) 4267 (setq requests (delq request requests))))
4268 ;; Is there anything customized about this variable?
4268 (when (or (and spec (eq (car spec) 'user)) 4269 (when (or (and spec (eq (car spec) 'user))
4269 comment 4270 comment
4270 (and (null spec) (get symbol 'saved-value))) 4271 (and (null spec) (get symbol 'saved-value)))
4272 ;; Output an element for this variable.
4273 ;; It has the form (SYMBOL VALUE-FORM NOW REQUESTS COMMENT).
4274 ;; SYMBOL is the variable name.
4275 ;; VALUE-FORM is an expression to return the customized value.
4276 ;; NOW if non-nil means always set the variable immediately
4277 ;; when the customizations are reloaded. This is used
4278 ;; for rogue variables
4279 ;; REQUESTS is a list of packages to load before setting the
4280 ;; variable. Each element of it will be passed to `require'.
4281 ;; COMMENT is whatever comment the user has specified
4282 ;; with the customize facility.
4271 (unless (bolp) 4283 (unless (bolp)
4272 (princ "\n")) 4284 (princ "\n"))
4273 (princ " '(") 4285 (princ " '(")
4274 (prin1 symbol) 4286 (prin1 symbol)
4275 (princ " ") 4287 (princ " ")
4433 ;; This keymap should be dense, but a dense keymap would prevent inheriting 4445 ;; This keymap should be dense, but a dense keymap would prevent inheriting
4434 ;; "\r" bindings from the parent map. 4446 ;; "\r" bindings from the parent map.
4435 ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26. 4447 ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26.
4436 (let ((map (make-keymap))) 4448 (let ((map (make-keymap)))
4437 (set-keymap-parent map widget-keymap) 4449 (set-keymap-parent map widget-keymap)
4438 (define-key map [remap self-insert-command] 'custom-no-edit) 4450 (define-key map [remap self-insert-command] 'Custom-no-edit)
4439 (define-key map "\^m" 'custom-newline) 4451 (define-key map "\^m" 'Custom-newline)
4440 (define-key map " " 'scroll-up) 4452 (define-key map " " 'scroll-up)
4441 (define-key map "\177" 'scroll-down) 4453 (define-key map "\177" 'scroll-down)
4442 (define-key map "\C-c\C-c" 'Custom-set) 4454 (define-key map "\C-c\C-c" 'Custom-set)
4443 (define-key map "\C-x\C-s" 'Custom-save) 4455 (define-key map "\C-x\C-s" 'Custom-save)
4444 (define-key map "q" 'Custom-buffer-done) 4456 (define-key map "q" 'Custom-buffer-done)
4446 (define-key map "n" 'widget-forward) 4458 (define-key map "n" 'widget-forward)
4447 (define-key map "p" 'widget-backward) 4459 (define-key map "p" 'widget-backward)
4448 map) 4460 map)
4449 "Keymap for `custom-mode'.") 4461 "Keymap for `custom-mode'.")
4450 4462
4451 (defun custom-no-edit (pos &optional event) 4463 (defun Custom-no-edit (pos &optional event)
4452 "Invoke button at POS, or refuse to allow editing of Custom buffer." 4464 "Invoke button at POS, or refuse to allow editing of Custom buffer."
4453 (interactive "@d") 4465 (interactive "@d")
4454 (error "You can't edit this part of the Custom buffer")) 4466 (error "You can't edit this part of the Custom buffer"))
4455 4467
4456 (defun custom-newline (pos &optional event) 4468 (defun Custom-newline (pos &optional event)
4457 "Invoke button at POS, or refuse to allow editing of Custom buffer." 4469 "Invoke button at POS, or refuse to allow editing of Custom buffer."
4458 (interactive "@d") 4470 (interactive "@d")
4459 (let ((button (get-char-property pos 'button))) 4471 (let ((button (get-char-property pos 'button)))
4460 (if button 4472 (if button
4461 (widget-apply-action button event) 4473 (widget-apply-action button event)