From f27187f963e9e36435b508e29256e048799e0ff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Sun, 2 Feb 2020 12:48:51 +0100 Subject: 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). --- lisp/subr.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp') 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))) -- cgit v1.2.1