emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104007: * lisp/custom.el (defcustom)


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104007: * lisp/custom.el (defcustom): Obey lexical-binding.
Date: Mon, 25 Apr 2011 13:52:51 -0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104007
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2011-04-25 13:52:51 -0300
message:
  * lisp/custom.el (defcustom): Obey lexical-binding.
modified:
  lisp/ChangeLog
  lisp/custom.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-04-25 16:29:31 +0000
+++ b/lisp/ChangeLog    2011-04-25 16:52:51 +0000
@@ -1,5 +1,7 @@
 2011-04-25  Stefan Monnier  <address@hidden>
 
+       * custom.el (defcustom): Obey lexical-binding.
+
        Fix octave-inf completion problems reported by Alexander Klimov.
        * progmodes/octave-inf.el (inferior-octave-mode-syntax-table):
        Inherit from octave-mode-syntax-table.

=== modified file 'lisp/custom.el'
--- a/lisp/custom.el    2011-04-19 13:44:55 +0000
+++ b/lisp/custom.el    2011-04-25 16:52:51 +0000
@@ -313,11 +313,19 @@
   ;; 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.
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]