unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Hong Xu <hong@topbug.net>
To: 38026@debbugs.gnu.org
Subject: bug#38026: [PATCH] Explain negative NABS in `goto-history-element'.
Date: Fri, 01 Nov 2019 18:08:38 -0700	[thread overview]
Message-ID: <8736f7ccfd.fsf@topbug.net> (raw)


* doc/lispref/minibuf.texi (Minibuffer Commands): Explain negative NABS.

* lisp/simple.el (goto-history-element): Explain negative NABS.
---
 doc/lispref/minibuf.texi | 5 +++++
 lisp/simple.el           | 7 ++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index d36babd69873..a9bb3aec9583 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -2339,6 +2339,11 @@ Minibuffer Commands
 minibuffer.  The argument @var{nabs} specifies the absolute history
 position in descending order, where 0 means the current element and a
 positive number @var{n} means the @var{n}th previous element.
+
+@{nabs} being a negative number @var{n} means the @var{n-1}th element
+of @code{minibuffer-default} if it is a list, or otherwise the value
+of @code{minibuffer-default}.  This is usually an intelligent guess of
+what the user intends to input."
 @end deffn
 
 @node Minibuffer Windows
diff --git a/lisp/simple.el b/lisp/simple.el
index 10aecd651f39..e95e2bc22972 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2130,7 +2130,12 @@ goto-history-element
   "Puts element of the minibuffer history in the minibuffer.
 The argument NABS specifies the absolute history position in
 descending order, where 0 means the current element and a
-positive number N means the Nth previous element."
+positive number N means the Nth previous element.
+
+NABS being a negative number N means the (N-1)th element of
+`minibuffer-default' if it is a list, or otherwise the value of
+`minibuffer-default'.  This is usually an intelligent guess of
+what the user intends to input."
   (interactive "p")
   (when (and (not minibuffer-default-add-done)
 	     (functionp minibuffer-default-add-function)
-- 
2.20.1







             reply	other threads:[~2019-11-02  1:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-02  1:08 Hong Xu [this message]
2019-11-02  8:03 ` bug#38026: [PATCH] Explain negative NABS in `goto-history-element' Eli Zaretskii
2019-11-02 17:07   ` Hong Xu
2019-11-02 17:54     ` Eli Zaretskii
2019-11-03  5:11       ` Hong Xu
2019-11-09  9:46         ` Eli Zaretskii
2019-11-09 18:48           ` Hong Xu
2019-11-09 20:00             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736f7ccfd.fsf@topbug.net \
    --to=hong@topbug.net \
    --cc=38026@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).