aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/cus-edit.el22
1 files changed, 22 insertions, 0 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 4d4fc083553..77b946ece1a 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -868,6 +868,28 @@ are shown; the contents of those subgroups are initially hidden."
868(defun customize-option (symbol) 868(defun customize-option (symbol)
869 "Customize SYMBOL, which must be a user option variable." 869 "Customize SYMBOL, which must be a user option variable."
870 (interactive (custom-variable-prompt)) 870 (interactive (custom-variable-prompt))
871 ;; If we don't have SYMBOL's real definition loaded,
872 ;; try to load it.
873 (unless (get symbol 'custom-type)
874 (let ((loaddefs-file (locate-library "loaddefs.el" t))
875 file)
876 ;; See if it is autoloaded from some library.
877 (when loaddefs-file
878 (with-temp-buffer
879 (insert-file-contents loaddefs-file)
880 (when (re-search-forward (concat "^(defvar " (symbol-name symbol))
881 nil t)
882 (search-backward "\n;;; Generated autoloads from ")
883 (goto-char (match-end 0))
884 (setq file (buffer-substring (point)
885 (progn (end-of-line) (point)))))))
886 ;; If it is, load that library.
887 (when file
888 (when (string-match "\\.el\\'" file)
889 (setq file (substring file 0 (match-beginning 0))))
890 (load file))))
891 (unless (get symbol 'custom-type)
892 (error "Variable %s cannot be customized" symbol))
871 (custom-buffer-create (list (list symbol 'custom-variable)) 893 (custom-buffer-create (list (list symbol 'custom-variable))
872 (format "*Customize Option: %s*" 894 (format "*Customize Option: %s*"
873 (custom-unlispify-tag-name symbol)))) 895 (custom-unlispify-tag-name symbol))))