diff options
| author | Glenn Morris | 2017-02-20 18:30:40 -0800 |
|---|---|---|
| committer | Glenn Morris | 2017-02-20 18:30:40 -0800 |
| commit | 96cea19842b577eb4f2e057d702aea54d736233e (patch) | |
| tree | 7297de21f5f6936b8e4409b84466d474b30f7332 | |
| parent | 08c73cdc6e2436473b467e207c1a713bb271da11 (diff) | |
| download | emacs-96cea19842b577eb4f2e057d702aea54d736233e.tar.gz emacs-96cea19842b577eb4f2e057d702aea54d736233e.zip | |
Ensure delayed-init custom variables get marked special
* lisp/custom.el (custom-reevaluate-setting):
If the variable has never been set, defvar it. (Bug#25770)
| -rw-r--r-- | lisp/custom.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/custom.el b/lisp/custom.el index 70b6839db3d..7eaff450c5d 100644 --- a/lisp/custom.el +++ b/lisp/custom.el | |||
| @@ -764,9 +764,17 @@ Return non-nil if the `customized-value' property actually changed." | |||
| 764 | Use the :set function to do so. This is useful for customizable options | 764 | Use the :set function to do so. This is useful for customizable options |
| 765 | that are defined before their standard value can really be computed. | 765 | that are defined before their standard value can really be computed. |
| 766 | E.g. dumped variables whose default depends on run-time information." | 766 | E.g. dumped variables whose default depends on run-time information." |
| 767 | (funcall (or (get symbol 'custom-set) 'set-default) | 767 | (let ((val (car (or (get symbol 'saved-value) |
| 768 | symbol | 768 | (get symbol 'standard-value))))) |
| 769 | (eval (car (or (get symbol 'saved-value) (get symbol 'standard-value)))))) | 769 | (if (default-boundp symbol) |
| 770 | (funcall (or (get symbol 'custom-set) 'set-default) symbol (eval val)) | ||
| 771 | ;; If it has never been set at all, defvar it so as to mark it | ||
| 772 | ;; special, etc (bug#25770). This ignores any :set function, | ||
| 773 | ;; but that is not supposed to be used for initialization anyway. | ||
| 774 | ;; Or we could move this branch to the start, then unconditionally | ||
| 775 | ;; call the custom-set branch. | ||
| 776 | (eval `(defvar ,symbol ,val))))) | ||
| 777 | |||
| 770 | 778 | ||
| 771 | 779 | ||
| 772 | ;;; Custom Themes | 780 | ;;; Custom Themes |