[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-27 f27187f: Clarify lexvar restrictions for add-to-ordered-list, a
From: |
Mattias Engdegård |
Subject: |
emacs-27 f27187f: Clarify lexvar restrictions for add-to-ordered-list, add-to-history |
Date: |
Sun, 2 Feb 2020 06:53:27 -0500 (EST) |
branch: emacs-27
commit f27187f963e9e36435b508e29256e048799e0ff2
Author: Mattias Engdegård <address@hidden>
Commit: Mattias Engdegård <address@hidden>
Clarify lexvar restrictions for add-to-ordered-list, add-to-history
* lisp/subr.el (add-to-ordered-list, add-to-history):
* doc/lispref/lists.texi (List Variables):
* doc/lispref/minibuf.texi (Minibuffer History):
Note in the doc string and manual that the variable arguments to
add-to-ordered-list and add-to-history cannot refer to a lexical
variable (bug#39373).
---
doc/lispref/lists.texi | 1 +
doc/lispref/minibuf.texi | 1 +
lisp/subr.el | 4 +++-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index ce0d9a3..27fa538 100644
--- a/doc/lispref/lists.texi
+++ b/doc/lispref/lists.texi
@@ -832,6 +832,7 @@ and unlike @code{setq}. Quote the argument yourself if
necessary.
The ordering information is stored in a hash table on @var{symbol}'s
@code{list-order} property.
+@var{symbol} cannot refer to a lexical variable.
@end defun
Here's a scenario showing how to use @code{add-to-ordered-list}:
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index ab806a9..1266cf8 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -572,6 +572,7 @@ and returns the updated history list. It limits the list
length to
the value of @var{maxelt} (if non-@code{nil}) or @code{history-length}
(described below). The possible values of @var{maxelt} have the same
meaning as the values of @code{history-length}.
+@var{history-var} cannot refer to a lexical variable.
Normally, @code{add-to-history} removes duplicate members from the
history list if @code{history-delete-duplicates} is non-@code{nil}.
diff --git a/lisp/subr.el b/lisp/subr.el
index 05fb823..c1c4cad 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1935,6 +1935,7 @@ of ELEMENT if it has one.
The list order for each element is stored in LIST-VAR's
`list-order' property.
+LIST-VAR cannot refer to a lexical variable.
The return value is the new value of LIST-VAR."
(let ((ordering (get list-var 'list-order)))
@@ -1963,7 +1964,8 @@ variable. The possible values of maximum length have the
same meaning as
the values of `history-length'.
Remove duplicates of NEWELT if `history-delete-duplicates' is non-nil.
If optional fourth arg KEEP-ALL is non-nil, add NEWELT to history even
-if it is empty or duplicates the most recent entry in the history."
+if it is empty or duplicates the most recent entry in the history.
+HISTORY-VAR cannot refer to a lexical variable."
(unless maxelt
(setq maxelt (or (get history-var 'history-length)
history-length)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-27 f27187f: Clarify lexvar restrictions for add-to-ordered-list, add-to-history,
Mattias Engdegård <=