[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r107139: * lisp/custom.el (defcustom)
From: |
Chong Yidong |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r107139: * lisp/custom.el (defcustom): Another doc fix. |
Date: |
Mon, 06 Feb 2012 20:48:07 +0800 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 107139
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2012-02-06 20:48:07 +0800
message:
* lisp/custom.el (defcustom): Another doc fix.
modified:
lisp/custom.el
=== modified file 'lisp/custom.el'
--- a/lisp/custom.el 2012-02-06 12:36:31 +0000
+++ b/lisp/custom.el 2012-02-06 12:48:07 +0000
@@ -198,14 +198,14 @@
(run-hooks 'custom-define-hook)
symbol)
-(defmacro defcustom (symbol value doc &rest args)
- "Declare SYMBOL as a customizable variable that defaults to VALUE.
+(defmacro defcustom (symbol standard doc &rest args)
+ "Declare SYMBOL as a customizable variable.
SYMBOL is the variable name; it should not be quoted.
-VALUE is an expression specifying the variable's standard value.
-This expression should not be quoted. It is evaluated once by
+STANDARD is an expression specifying the variable's standard
+value. It should not be quoted. It is evaluated once by
`defcustom', and the value is assigned to SYMBOL if the variable
-is unbound. The expression may also be re-evaluated by Customize
-whenever it needs to get the variable's standard value.
+is unbound. The expression itself is also stored, so that
+Customize can re-evaluate it later to get the standard value.
DOC is the variable documentation.
The remaining arguments should have the form
@@ -324,14 +324,15 @@
`(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)
+ ;; The STANDARD arg should be an expression that evaluates to
+ ;; the standard value. 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 `standard'
+ ;; 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 () ,standard))
+ `',standard)
,doc
,@args))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r107139: * lisp/custom.el (defcustom): Another doc fix.,
Chong Yidong <=