aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2020-10-20 13:28:29 +0200
committerLars Ingebrigtsen2020-10-20 13:28:29 +0200
commit4ef8c4a0f4e26f6ea2186a2b80c068b8d93e4993 (patch)
tree53c4d79934bb5fce1dd92b01e995286442a78f46
parente3fa592899f6999fda9fdaaab3929f346ce67f66 (diff)
downloademacs-4ef8c4a0f4e26f6ea2186a2b80c068b8d93e4993.tar.gz
emacs-4ef8c4a0f4e26f6ea2186a2b80c068b8d93e4993.zip
Tweak the documentation for define-obsolete-variable-alias
* doc/lispref/variables.texi (Variable Aliases): Actually describe the macro parameters (bug#44088). * lisp/emacs-lisp/byte-run.el (define-obsolete-variable-alias): Ditto (bug#44088).
-rw-r--r--doc/lispref/variables.texi8
-rw-r--r--lisp/emacs-lisp/byte-run.el14
2 files changed, 18 insertions, 4 deletions
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 6c0b3b5be1b..394fb96acbe 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -2385,6 +2385,14 @@ equivalent to the following:
2385(defvaralias @var{obsolete-name} @var{current-name} @var{docstring}) 2385(defvaralias @var{obsolete-name} @var{current-name} @var{docstring})
2386(make-obsolete-variable @var{obsolete-name} @var{current-name} @var{when}) 2386(make-obsolete-variable @var{obsolete-name} @var{current-name} @var{when})
2387@end example 2387@end example
2388
2389This macro evaluates all its parameters, and both @var{obsolete-name}
2390and @var{current-name} should be symbols, so a typical usage would
2391look like:
2392
2393@lisp
2394(define-obsolete-variable-alias 'foo-thing 'bar-thing "27.1")
2395@end lisp
2388@end defmac 2396@end defmac
2389 2397
2390@defun indirect-variable variable 2398@defun indirect-variable variable
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 5279a57cd0c..27f54d0ca2a 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -432,7 +432,16 @@ ACCESS-TYPE if non-nil should specify the kind of access that will trigger
432(defmacro define-obsolete-variable-alias (obsolete-name current-name 432(defmacro define-obsolete-variable-alias (obsolete-name current-name
433 &optional when docstring) 433 &optional when docstring)
434 "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete. 434 "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
435This uses `defvaralias' and `make-obsolete-variable' (which see). 435
436WHEN should be a string indicating when the variable was first
437made obsolete, for example a date or a release number.
438
439This macro evaluates all its parameters, and both OBSOLETE-NAME
440and CURRENT-NAME should be symbols, so a typical usage would look like:
441
442 (define-obsolete-variable-alias 'foo-thing 'bar-thing \"27.1\")
443
444This macro uses `defvaralias' and `make-obsolete-variable' (which see).
436See the Info node `(elisp)Variable Aliases' for more details. 445See the Info node `(elisp)Variable Aliases' for more details.
437 446
438If CURRENT-NAME is a defcustom or a defvar (more generally, any variable 447If CURRENT-NAME is a defcustom or a defvar (more generally, any variable
@@ -446,9 +455,6 @@ dumped with Emacs). This is so that any user customizations are
446applied before the defcustom tries to initialize the 455applied before the defcustom tries to initialize the
447variable (this is due to the way `defvaralias' works). 456variable (this is due to the way `defvaralias' works).
448 457
449WHEN should be a string indicating when the variable was first
450made obsolete, for example a date or a release number.
451
452For the benefit of Customize, if OBSOLETE-NAME has 458For the benefit of Customize, if OBSOLETE-NAME has
453any of the following properties, they are copied to 459any of the following properties, they are copied to
454CURRENT-NAME, if it does not already have them: 460CURRENT-NAME, if it does not already have them: