aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2009-10-16 06:48:24 +0000
committerGlenn Morris2009-10-16 06:48:24 +0000
commit850bfd0444b2bae17a99e0d026af8d507dd69cb0 (patch)
treeaf587503f1b7ab0883b3498129ea43a5545b025f
parentf3ed9aca2816b6488ad2ea0733adfa22079dad57 (diff)
downloademacs-850bfd0444b2bae17a99e0d026af8d507dd69cb0.tar.gz
emacs-850bfd0444b2bae17a99e0d026af8d507dd69cb0.zip
(define-obsolete-variable-alias): Doc fix.
Maybe copy some custom properties from old to new name. (Bug#4706)
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/byte-run.el34
2 files changed, 24 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d48b95612b3..883285b20c5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12009-10-16 Glenn Morris <rgm@gnu.org>
2
3 * emacs-lisp/byte-run.el (define-obsolete-variable-alias): Doc fix.
4 Maybe copy some custom properties from old to new name. (Bug#4706)
5
12009-10-16 Juanma Barranquero <lekktu@gmail.com> 62009-10-16 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * subr.el (error, sit-for, start-process-shell-command) 8 * subr.el (error, sit-for, start-process-shell-command)
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 5c4eeae0cde..7b0faec655c 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -175,28 +175,32 @@ was first made obsolete, for example a date or a release number."
175(defmacro define-obsolete-variable-alias (obsolete-name current-name 175(defmacro define-obsolete-variable-alias (obsolete-name current-name
176 &optional when docstring) 176 &optional when docstring)
177 "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete. 177 "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
178 178This uses `defvaralias' and `make-obsolete-variable' (which see).
179\(define-obsolete-variable-alias 'old-var 'new-var \"22.1\" \"old-var's doc.\") 179See the Info node `(elisp)Variable Aliases' for more details.
180
181is equivalent to the following two lines of code:
182
183\(defvaralias 'old-var 'new-var \"old-var's doc.\")
184\(make-obsolete-variable 'old-var 'new-var \"22.1\")
185 180
186If CURRENT-NAME is a defcustom (more generally, any variable 181If CURRENT-NAME is a defcustom (more generally, any variable
187where OBSOLETE-NAME may be set, e.g. in a .emacs file, before the 182where OBSOLETE-NAME may be set, e.g. in a .emacs file, before the
188alias is defined), then the define-obsolete-variable-alias 183alias is defined), then the define-obsolete-variable-alias
189statement should be placed before the defcustom. This is so that 184statement should be evaluated before the defcustom, if user
190any user customizations are applied before the defcustom tries to 185customizations are to be respected. The simplest way to achieve
191initialize the variable (this is due to the way `defvaralias' works). 186this is to place the alias statement before the defcustom (this
192Exceptions to this rule occur for define-obsolete-variable-alias 187is not necessary for aliases that are autoloaded, or in files
193statements that are autoloaded, or in files dumped with Emacs. 188dumped with Emacs). This is so that any user customizations are
194 189applied before the defcustom tries to initialize the
195See the docstrings of `defvaralias' and `make-obsolete-variable' or 190variable (this is due to the way `defvaralias' works).
196Info node `(elisp)Variable Aliases' for more details." 191
192For the benefit of `custom-set-variables', if OBSOLETE-NAME has
193any of the following properties, they are copied to
194CURRENT-NAME, if it does not already have them:
195'saved-value, 'saved-variable-comment."
197 (declare (doc-string 4)) 196 (declare (doc-string 4))
198 `(progn 197 `(progn
199 (defvaralias ,obsolete-name ,current-name ,docstring) 198 (defvaralias ,obsolete-name ,current-name ,docstring)
199 ;; See Bug#4706.
200 (mapc (lambda (prop) (or (get ,current-name prop)
201 (put ,current-name prop
202 (get ,obsolete-name prop))))
203 '(saved-value saved-variable-comment))
200 (make-obsolete-variable ,obsolete-name ,current-name ,when))) 204 (make-obsolete-variable ,obsolete-name ,current-name ,when)))
201(set-advertised-calling-convention 205(set-advertised-calling-convention
202 ;; New code should always provide the `when' argument. 206 ;; New code should always provide the `when' argument.