changeset 49104:b74a6560ecbb

(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.
author Markus Rost <rost@math.uni-bielefeld.de>
date Tue, 07 Jan 2003 19:29:25 +0000
parents 7c84e7bb3879
children 9cd789fbff75
files lisp/cus-edit.el
diffstat 1 files changed, 6 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/cus-edit.el	Tue Jan 07 19:25:20 2003 +0000
+++ b/lisp/cus-edit.el	Tue Jan 07 19:29:25 2003 +0000
@@ -384,20 +384,16 @@
     regexp))
 
 (defun custom-variable-prompt ()
-  "Prompt for a variable, defaulting to the variable at point.
+  "Prompt for a custom variable, defaulting to the variable at point.
 Return a list suitable for use in `interactive'."
    (let ((v (variable-at-point))
 	 (enable-recursive-minibuffers t)
 	 val)
      (setq val (completing-read
-		(if (symbolp v)
+		(if (and (symbolp v) (custom-variable-p v))
 		    (format "Customize option: (default %s) " v)
-		  "Customize variable: ")
-		obarray (lambda (symbol)
-			  (and (boundp symbol)
-			       (or (get symbol 'custom-type)
-				   (get symbol 'custom-loads)
-				   (get symbol 'standard-value)))) t))
+		  "Customize option: ")
+		obarray 'custom-variable-p t))
      (list (if (equal val "")
 	       (if (symbolp v) v nil)
 	     (intern val)))))
@@ -928,28 +924,6 @@
 (defun customize-option (symbol)
   "Customize SYMBOL, which must be a user option variable."
   (interactive (custom-variable-prompt))
-  ;; If we don't have SYMBOL's real definition loaded,
-  ;; try to load it.
-  (unless (get symbol 'custom-type)
-    (let ((loaddefs-file (locate-library "loaddefs.el" t))
-	  file)
-      ;; See if it is autoloaded from some library.
-      (when loaddefs-file
-	(with-temp-buffer
-	  (insert-file-contents loaddefs-file)
-	  (when (re-search-forward (concat "^(defvar " (symbol-name symbol))
-				   nil t)
-	    (search-backward "\n;;; Generated autoloads from ")
-	    (goto-char (match-end 0))
-	    (setq file (buffer-substring (point)
-					 (progn (end-of-line) (point)))))))
-      ;; If it is, load that library.
-      (when file
-	(when (string-match "\\.el\\'" file)
-	  (setq file (substring file 0 (match-beginning 0))))
-	(load file))))
-  (unless (get symbol 'custom-type)
-    (error "Variable %s cannot be customized" symbol))
   (custom-buffer-create (list (list symbol 'custom-variable))
 			(format "*Customize Option: %s*"
 				(custom-unlispify-tag-name symbol))))
@@ -1171,7 +1145,7 @@
 		  (when (and (not (memq all '(groups faces)))
 			     (boundp symbol)
 			     (or (get symbol 'saved-value)
-				 (get symbol 'standard-value)
+				 (custom-variable-p symbol)
 				 (if (memq all '(nil options))
 				     (user-variable-p symbol)
 				   (get symbol 'variable-documentation))))
@@ -3745,7 +3719,7 @@
 	 (let ((spec (car-safe (get symbol 'theme-value)))
 	       (value (get symbol 'saved-value))
 	       (requests (get symbol 'custom-requests))
-	       (now (not (or (get symbol 'standard-value)
+	       (now (not (or (custom-variable-p symbol)
 			     (and (not (boundp symbol))
 				  (not (eq (get symbol 'force-value)
 					   'rogue))))))