# HG changeset patch # User Karl Heuer # Date 904942091 0 # Node ID 0fe0fe296153642c5e9b01d94df0b81527966533 # Parent ac0f6ede7b665c83bd9f11ce0bcb0b7bbed87892 (customize-option): Refuse to customize a variable that has no defcustom. But if variable is autoloaded, first try to load the library that defines it. diff -r ac0f6ede7b66 -r 0fe0fe296153 lisp/cus-edit.el --- a/lisp/cus-edit.el Fri Sep 04 20:46:30 1998 +0000 +++ b/lisp/cus-edit.el Fri Sep 04 20:48:11 1998 +0000 @@ -868,6 +868,28 @@ (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))))