diff options
| author | Lars Ingebrigtsen | 2020-10-20 13:28:29 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-10-20 13:28:29 +0200 |
| commit | 4ef8c4a0f4e26f6ea2186a2b80c068b8d93e4993 (patch) | |
| tree | 53c4d79934bb5fce1dd92b01e995286442a78f46 | |
| parent | e3fa592899f6999fda9fdaaab3929f346ce67f66 (diff) | |
| download | emacs-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.texi | 8 | ||||
| -rw-r--r-- | 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 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 | |||
| 2389 | This macro evaluates all its parameters, and both @var{obsolete-name} | ||
| 2390 | and @var{current-name} should be symbols, so a typical usage would | ||
| 2391 | look 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. |
| 435 | This uses `defvaralias' and `make-obsolete-variable' (which see). | 435 | |
| 436 | WHEN should be a string indicating when the variable was first | ||
| 437 | made obsolete, for example a date or a release number. | ||
| 438 | |||
| 439 | This macro evaluates all its parameters, and both OBSOLETE-NAME | ||
| 440 | and 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 | |||
| 444 | This macro uses `defvaralias' and `make-obsolete-variable' (which see). | ||
| 436 | See the Info node `(elisp)Variable Aliases' for more details. | 445 | See the Info node `(elisp)Variable Aliases' for more details. |
| 437 | 446 | ||
| 438 | If CURRENT-NAME is a defcustom or a defvar (more generally, any variable | 447 | 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 | |||
| 446 | applied before the defcustom tries to initialize the | 455 | applied before the defcustom tries to initialize the |
| 447 | variable (this is due to the way `defvaralias' works). | 456 | variable (this is due to the way `defvaralias' works). |
| 448 | 457 | ||
| 449 | WHEN should be a string indicating when the variable was first | ||
| 450 | made obsolete, for example a date or a release number. | ||
| 451 | |||
| 452 | For the benefit of Customize, if OBSOLETE-NAME has | 458 | For the benefit of Customize, if OBSOLETE-NAME has |
| 453 | any of the following properties, they are copied to | 459 | any of the following properties, they are copied to |
| 454 | CURRENT-NAME, if it does not already have them: | 460 | CURRENT-NAME, if it does not already have them: |