unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: laszlomail--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	"46033@debbugs.gnu.org" <46033@debbugs.gnu.org>
Subject: bug#46033: up arrow in query replace should not step into the prompt
Date: Sat, 23 Jan 2021 18:17:22 +0000	[thread overview]
Message-ID: <iBKwFG8vOZ5HrQ03Of__sqGe44v1s8FZVqmDumtr4R9vaKiizHBGTBZ7LmVgf87ZEZqwrXBxAi8fqneC0ZKYHeHQDE0tIq920msJh-s2GY4=@protonmail.com> (raw)
In-Reply-To: <fRNIEZ9RO7jGgMXJwpGOODl_KL6NFysUTHzA1ROhXhBBixxRd2U4SMXcIRjtXrkKM3ct_RZCFv8QM6yBn2okhJCU_pyqTNtT9323XNe11RY=@protonmail.com>

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

>
> In this specific case up arrow should also retrieve the previous
> history, instead of going into the prompt which is useless in
> this case.
>

Attached a patch doing what I propose.

[-- Attachment #2: prompt.patch --]
[-- Type: application/octet-stream, Size: 777 bytes --]

c:/Progra~2/GnuWin32/bin/diff.exe -u "c:/Program Files/emacs-27.1/share/emacs/27.1/lisp/simple.el" "d:/download/simple.el"
--- c:/Program Files/emacs-27.1/share/emacs/27.1/lisp/simple.el	2020-08-12 08:36:54.000000000 +0200
+++ d:/download/simple.el	2021-01-23 19:15:00.428631300 +0100
@@ -2303,6 +2303,9 @@
 			 (current-column)))))
     (condition-case nil
 	(with-no-warnings
+          (if (eq (point-min) ;; prompt is entirely visible
+                  (- (minibuffer-prompt-end) (length (minibuffer-prompt))))
+              (signal 'beginning-of-buffer nil)) ;; get previous history item
 	  (previous-line arg))
       (beginning-of-buffer
        ;; Restore old position since `line-move-visual' moves point to

Diff finished.  Sat Jan 23 19:15:02 2021

  reply	other threads:[~2021-01-23 18:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22 13:21 bug#46033: up arrow in query replace should not step into the prompt laszlomail--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-22 13:55 ` Eli Zaretskii
2021-01-22 14:16   ` laszlomail--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-23 17:24     ` Juri Linkov
2021-01-23 17:46       ` laszlomail--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-23 18:34         ` Juri Linkov
2021-01-23 18:53           ` laszlomail--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-25 17:14             ` Juri Linkov
2021-01-27 18:10               ` Juri Linkov
2021-01-22 18:44   ` Lars Ingebrigtsen
2021-01-22 18:52     ` Eli Zaretskii
2021-01-23 17:35       ` laszlomail--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-23 18:17         ` laszlomail--- via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-01-23 18:30           ` laszlomail--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-01-23 18:33             ` laszlomail--- via Bug reports for GNU Emacs, the Swiss army knife of text editors

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='iBKwFG8vOZ5HrQ03Of__sqGe44v1s8FZVqmDumtr4R9vaKiizHBGTBZ7LmVgf87ZEZqwrXBxAi8fqneC0ZKYHeHQDE0tIq920msJh-s2GY4=@protonmail.com' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=46033@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=laszlomail@protonmail.com \
    /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).