diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-04-25 13:52:51 -0300 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2011-04-25 13:52:51 -0300 |
commit | 850256b5e9fa9f03008b843e58b1b338d86877f5 (patch) | |
tree | df7dab0a3d7db426f7468e6b0bf8354aed5eb65b /lisp/custom.el | |
parent | e92f3bd31bba8010468c91b6af7090652969679b (diff) | |
download | emacs-850256b5e9fa9f03008b843e58b1b338d86877f5.tar.gz |
* lisp/custom.el (defcustom): Obey lexical-binding.
Diffstat (limited to 'lisp/custom.el')
-rw-r--r-- | lisp/custom.el | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/custom.el b/lisp/custom.el index 9673db47ea8..8295777f1f1 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -313,11 +313,19 @@ for more information." ;; It is better not to use backquote in this file, ;; because that makes a bootstrapping problem ;; if you need to recompile all the Lisp files using interpreted code. - (nconc (list 'custom-declare-variable - (list 'quote symbol) - (list 'quote value) - doc) - args)) + `(custom-declare-variable + ',symbol + ,(if lexical-binding ;FIXME: This is not reliable, but is all we have. + ;; The `default' arg should be an expression that evaluates to + ;; the value to use. The use of `eval' for it is spread over + ;; many different places and hence difficult to eliminate, yet + ;; we want to make sure that the `value' expression is checked by the + ;; byte-compiler, and that lexical-binding is obeyed, so quote the + ;; expression with `lambda' rather than with `quote'. + `(list (lambda () ,value)) + `',value) + ,doc + ,@args)) ;;; The `defface' Macro. |