Commit f27187f9 authored by Mattias Engdegård's avatar Mattias Engdegård

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).
parent 32763dac
Pipeline #4738 passed with stage
in 54 minutes and 59 seconds
......@@ -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}:
......
......@@ -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}.
......
......@@ -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)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment