diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index d16409d6c89..e922f1836b3 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 c900b0d7ce6..06a5e1e988c 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 a3c1b99bf32..f0258172766 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.