GNU bug report logs -
#46033
up arrow in query replace should not step into the prompt
Previous Next
Reported by: reporter <laszlomail <at> protonmail.com>
Date: Fri, 22 Jan 2021 13:23:02 UTC
Severity: normal
Tags: fixed
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
>> This is a feature: it allows you to scroll through the text shown in
>> the minibuffer, in case you want to edit it. Use M-p to go directly
>> to the previous history.
>
> I understand it's a feature, but as you see in the picture the prompt is
> empty, and the full default replacement is visible.
>
> In this case arrow should retrieve the previous history, instead of going
> into the prompt, because there is nothing to scroll.
Thanks for the well justified request. This patch avoids moving point
to the prompt on the rightful assumption that most of the time the users
would not want to edit read-only text:
[avoid-minibuffer-prompt.patch (text/x-diff, inline)]
diff --git a/lisp/simple.el b/lisp/simple.el
index 0355ac863a..f5fe366f69 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2476,7 +2476,10 @@ previous-line-or-history-element
(current-column)))))
(condition-case nil
(with-no-warnings
- (previous-line arg))
+ (previous-line arg)
+ ;; Avoid moving point to the prompt
+ (when (< (point) (minibuffer-prompt-end))
+ (signal 'beginning-of-buffer nil)))
(beginning-of-buffer
;; Restore old position since `line-move-visual' moves point to
;; the beginning of the line when it fails to go to the previous line.
This bug report was last modified 4 years and 117 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.