summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/lists.texi1
-rw-r--r--doc/lispref/minibuf.texi1
-rw-r--r--lisp/subr.el4
3 files changed, 5 insertions, 1 deletions
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi
index ce0d9a3c922..27fa5385e35 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 ab806a9055d..1266cf8ef65 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 05fb82321e5..c1c4cad18d1 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)))