emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 077dae3: completing-read: If HIST is the symbol `t', history is n


From: Stefan Monnier
Subject: master 077dae3: completing-read: If HIST is the symbol `t', history is not recorded.
Date: Mon, 19 Apr 2021 14:25:44 -0400 (EDT)

branch: master
commit 077dae3b4ca6a534a0c8061f7b5cf81639e39c3b
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    completing-read: If HIST is the symbol `t', history is not recorded.
    
    * lisp/minibuffer.el (completion-all-sorted-completions): Check if
    `minibuffer-history-variable` is `t`
    * src/minibuf.c (completing-read): Update docstring
    * doc/lispref/minibuf.texi: Update documentation of
    `read-from-minibuffer` and `completing-read`
---
 doc/lispref/minibuf.texi | 13 ++++++++-----
 lisp/minibuffer.el       |  2 +-
 src/minibuf.c            |  3 ++-
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index d16409d..e922f18 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -167,8 +167,10 @@ various applications such as completion.
 
 The argument @var{history} specifies a history list variable to use
 for saving the input and for history commands used in the minibuffer.
-It defaults to @code{minibuffer-history}.  You can optionally specify
-a starting position in the history list as well.  @xref{Minibuffer History}.
+It defaults to @code{minibuffer-history}.  If @var{history} is the
+symbol @code{t}, history is not recorded.  You can optionally specify
+a starting position in the history list as well.  @xref{Minibuffer
+History}.
 
 If the variable @code{minibuffer-allow-text-properties} is
 non-@code{nil}, then the string that is returned includes whatever text
@@ -1107,9 +1109,10 @@ The function @code{completing-read} uses
 @code{minibuffer-local-must-match-map} if @var{require-match} is
 non-@code{nil}.  @xref{Completion Commands}.
 
-The argument @var{history} specifies which history list variable to use for
-saving the input and for minibuffer history commands.  It defaults to
-@code{minibuffer-history}.  @xref{Minibuffer History}.
+The argument @var{history} specifies which history list variable to
+use for saving the input and for minibuffer history commands.  It
+defaults to @code{minibuffer-history}.  If @var{history} is the symbol
+@code{t}, history is not recorded.  @xref{Minibuffer History}.
 
 The argument @var{initial} is mostly deprecated; we recommend using a
 non-@code{nil} value only in conjunction with specifying a cons cell
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index c900b0d..06a5e1e 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1390,7 +1390,7 @@ scroll the window of possible completions."
            (t
             ;; Prefer shorter completions, by default.
             (setq all (sort all (lambda (c1 c2) (< (length c1) (length c2)))))
-            (if (minibufferp)
+            (if (and (minibufferp) (not (eq minibuffer-history-variable t)))
                 ;; Prefer recently used completions and put the default, if
                 ;; it exists, on top.
                 (let ((hist (symbol-value minibuffer-history-variable)))
diff --git a/src/minibuf.c b/src/minibuf.c
index a3c1b99..f025817 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2023,7 +2023,8 @@ HIST, if non-nil, specifies a history list and optionally 
the initial
   (This is the only case in which you should use INITIAL-INPUT instead
   of DEF.)  Positions are counted starting from 1 at the beginning of
   the list.  The variable `history-length' controls the maximum length
-  of a history list.
+  of a history list.  If HIST is the symbol `t', history is not
+  recorded.
 
 DEF, if non-nil, is the default value or the list of default values.
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]