emacs-diffs
[Top][All Lists]
Advanced

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

master 4ef8c4a: Tweak the documentation for define-obsolete-variable-ali


From: Lars Ingebrigtsen
Subject: master 4ef8c4a: Tweak the documentation for define-obsolete-variable-alias
Date: Tue, 20 Oct 2020 07:28:42 -0400 (EDT)

branch: master
commit 4ef8c4a0f4e26f6ea2186a2b80c068b8d93e4993
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 doc/lispref/variables.texi  |  8 ++++++++
 lisp/emacs-lisp/byte-run.el | 14 ++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 6c0b3b5..394fb96 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -2385,6 +2385,14 @@ equivalent to the following:
 (defvaralias @var{obsolete-name} @var{current-name} @var{docstring})
 (make-obsolete-variable @var{obsolete-name} @var{current-name} @var{when})
 @end example
+
+This macro evaluates all its parameters, and both @var{obsolete-name}
+and @var{current-name} should be symbols, so a typical usage would
+look like:
+
+@lisp
+(define-obsolete-variable-alias 'foo-thing 'bar-thing "27.1")
+@end lisp
 @end defmac
 
 @defun indirect-variable variable
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 5279a57..27f54d0 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
 (defmacro define-obsolete-variable-alias (obsolete-name current-name
                                                 &optional when docstring)
   "Make OBSOLETE-NAME a variable alias for CURRENT-NAME and mark it obsolete.
-This uses `defvaralias' and `make-obsolete-variable' (which see).
+
+WHEN should be a string indicating when the variable was first
+made obsolete, for example a date or a release number.
+
+This macro evaluates all its parameters, and both OBSOLETE-NAME
+and CURRENT-NAME should be symbols, so a typical usage would look like:
+
+  (define-obsolete-variable-alias 'foo-thing 'bar-thing \"27.1\")
+
+This macro uses `defvaralias' and `make-obsolete-variable' (which see).
 See the Info node `(elisp)Variable Aliases' for more details.
 
 If 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
 applied before the defcustom tries to initialize the
 variable (this is due to the way `defvaralias' works).
 
-WHEN should be a string indicating when the variable was first
-made obsolete, for example a date or a release number.
-
 For the benefit of Customize, if OBSOLETE-NAME has
 any of the following properties, they are copied to
 CURRENT-NAME, if it does not already have them:



reply via email to

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