From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#46033: up arrow in query replace should not step into the prompt Date: Sat, 23 Jan 2021 19:24:50 +0200 Organization: LINKOV.NET Message-ID: <87ft2rd1ot.fsf@mail.linkov.net> References: <83czxx5b5j.fsf@gnu.org> <7sIywf2TKUTDST-QQJyKZzPIwKN6sUQuyb-1ReWQ09vPjrZwcAjSu-HOEwWJIAOio4ugVvqEYVcRFwMEJxN6rAitsq6Sf-dQkWQ67jHybfI=@protonmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21171"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: laszlomail@protonmail.com To: 46033@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 23 18:35:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3MoZ-0005Oj-DD for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jan 2021 18:35:11 +0100 Original-Received: from localhost ([::1]:54332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3MoY-0002s4-CL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jan 2021 12:35:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3MoQ-0002r4-Lw for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 12:35:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3MoQ-00024J-Dy for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 12:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l3MoQ-0002RY-9E for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 12:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jan 2021 17:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46033 X-GNU-PR-Package: emacs X-Debbugs-Original-To: laszlomail--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: reporter , Eli Zaretskii , "46033@debbugs.gnu.org" <46033@debbugs.gnu.org> Original-Received: via spool by submit@debbugs.gnu.org id=B.16114232579316 (code B ref -1); Sat, 23 Jan 2021 17:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Jan 2021 17:34:17 +0000 Original-Received: from localhost ([127.0.0.1]:35175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3Mng-0002QB-Jf for submit@debbugs.gnu.org; Sat, 23 Jan 2021 12:34:16 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:46978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l3Mnc-0002Pr-PR for submit@debbugs.gnu.org; Sat, 23 Jan 2021 12:34:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Mnc-0002Du-IX for bug-gnu-emacs@gnu.org; Sat, 23 Jan 2021 12:34:12 -0500 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:51759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Mna-0001km-Lv; Sat, 23 Jan 2021 12:34:12 -0500 X-Originating-IP: 91.129.98.64 Original-Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 070CC1C0004; Sat, 23 Jan 2021 17:34:01 +0000 (UTC) In-Reply-To: <7sIywf2TKUTDST-QQJyKZzPIwKN6sUQuyb-1ReWQ09vPjrZwcAjSu-HOEwWJIAOio4ugVvqEYVcRFwMEJxN6rAitsq6Sf-dQkWQ67jHybfI=@protonmail.com> (laszlomail's message of "Fri, 22 Jan 2021 14:16:38 +0000") Received-SPF: pass client-ip=217.70.183.197; envelope-from=juri@linkov.net; helo=relay5-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:198435 Archived-At: --=-=-= Content-Type: text/plain >> 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=avoid-minibuffer-prompt.patch 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. --=-=-=--