aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Rost2003-01-07 19:29:25 +0000
committerMarkus Rost2003-01-07 19:29:25 +0000
commit3a495e159a63c13c3fd64a7a3ee56a1bc76e8205 (patch)
tree2e98601a4098c9b24329ecefc03257f759c54ce9
parent90b4a157455de916dc809c85095766d7500c22d1 (diff)
downloademacs-3a495e159a63c13c3fd64a7a3ee56a1bc76e8205.tar.gz
emacs-3a495e159a63c13c3fd64a7a3ee56a1bc76e8205.zip
(custom-variable-prompt): Doc change. Use custom-variable-p.
(customize-option): Remove search in loaddefs.el. (customize-apropos): Use custom-variable-p. (custom-save-variables): Use custom-variable-p to detect non-rogue variables.
-rw-r--r--lisp/cus-edit.el38
1 files changed, 6 insertions, 32 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index e8eded3b1af..6017e7b9adf 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -384,20 +384,16 @@ IF REGEXP is not a string, return it unchanged."
384 regexp)) 384 regexp))
385 385
386(defun custom-variable-prompt () 386(defun custom-variable-prompt ()
387 "Prompt for a variable, defaulting to the variable at point. 387 "Prompt for a custom variable, defaulting to the variable at point.
388Return a list suitable for use in `interactive'." 388Return a list suitable for use in `interactive'."
389 (let ((v (variable-at-point)) 389 (let ((v (variable-at-point))
390 (enable-recursive-minibuffers t) 390 (enable-recursive-minibuffers t)
391 val) 391 val)
392 (setq val (completing-read 392 (setq val (completing-read
393 (if (symbolp v) 393 (if (and (symbolp v) (custom-variable-p v))
394 (format "Customize option: (default %s) " v) 394 (format "Customize option: (default %s) " v)
395 "Customize variable: ") 395 "Customize option: ")
396 obarray (lambda (symbol) 396 obarray 'custom-variable-p t))
397 (and (boundp symbol)
398 (or (get symbol 'custom-type)
399 (get symbol 'custom-loads)
400 (get symbol 'standard-value)))) t))
401 (list (if (equal val "") 397 (list (if (equal val "")
402 (if (symbolp v) v nil) 398 (if (symbolp v) v nil)
403 (intern val))))) 399 (intern val)))))
@@ -928,28 +924,6 @@ then prompt for the MODE to customize."
928(defun customize-option (symbol) 924(defun customize-option (symbol)
929 "Customize SYMBOL, which must be a user option variable." 925 "Customize SYMBOL, which must be a user option variable."
930 (interactive (custom-variable-prompt)) 926 (interactive (custom-variable-prompt))
931 ;; If we don't have SYMBOL's real definition loaded,
932 ;; try to load it.
933 (unless (get symbol 'custom-type)
934 (let ((loaddefs-file (locate-library "loaddefs.el" t))
935 file)
936 ;; See if it is autoloaded from some library.
937 (when loaddefs-file
938 (with-temp-buffer
939 (insert-file-contents loaddefs-file)
940 (when (re-search-forward (concat "^(defvar " (symbol-name symbol))
941 nil t)
942 (search-backward "\n;;; Generated autoloads from ")
943 (goto-char (match-end 0))
944 (setq file (buffer-substring (point)
945 (progn (end-of-line) (point)))))))
946 ;; If it is, load that library.
947 (when file
948 (when (string-match "\\.el\\'" file)
949 (setq file (substring file 0 (match-beginning 0))))
950 (load file))))
951 (unless (get symbol 'custom-type)
952 (error "Variable %s cannot be customized" symbol))
953 (custom-buffer-create (list (list symbol 'custom-variable)) 927 (custom-buffer-create (list (list symbol 'custom-variable))
954 (format "*Customize Option: %s*" 928 (format "*Customize Option: %s*"
955 (custom-unlispify-tag-name symbol)))) 929 (custom-unlispify-tag-name symbol))))
@@ -1171,7 +1145,7 @@ user-settable, as well as faces and groups."
1171 (when (and (not (memq all '(groups faces))) 1145 (when (and (not (memq all '(groups faces)))
1172 (boundp symbol) 1146 (boundp symbol)
1173 (or (get symbol 'saved-value) 1147 (or (get symbol 'saved-value)
1174 (get symbol 'standard-value) 1148 (custom-variable-p symbol)
1175 (if (memq all '(nil options)) 1149 (if (memq all '(nil options))
1176 (user-variable-p symbol) 1150 (user-variable-p symbol)
1177 (get symbol 'variable-documentation)))) 1151 (get symbol 'variable-documentation))))
@@ -3745,7 +3719,7 @@ or (if there were none) at the end of the buffer."
3745 (let ((spec (car-safe (get symbol 'theme-value))) 3719 (let ((spec (car-safe (get symbol 'theme-value)))
3746 (value (get symbol 'saved-value)) 3720 (value (get symbol 'saved-value))
3747 (requests (get symbol 'custom-requests)) 3721 (requests (get symbol 'custom-requests))
3748 (now (not (or (get symbol 'standard-value) 3722 (now (not (or (custom-variable-p symbol)
3749 (and (not (boundp symbol)) 3723 (and (not (boundp symbol))
3750 (not (eq (get symbol 'force-value) 3724 (not (eq (get symbol 'force-value)
3751 'rogue)))))) 3725 'rogue))))))