From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#27191: 26.0.50; Long history items in minibuffer (again) Date: Fri, 02 Jun 2017 23:17:24 +0200 Message-ID: <87y3tanl7f.fsf@rosalinde> References: <874lvzh1wo.fsf@rosalinde> <87zidqq0n3.fsf@rosalinde> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1496438292 24471 195.159.176.226 (2 Jun 2017 21:18:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Jun 2017 21:18:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: 27191@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 02 23:18:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGtxO-00061L-LL for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Jun 2017 23:18:06 +0200 Original-Received: from localhost ([::1]:51481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGtxU-0003xI-3l for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Jun 2017 17:18:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGtxN-0003ua-EF for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2017 17:18:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGtxK-0007WD-8b for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2017 17:18:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49298) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dGtxK-0007Vw-5E for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2017 17:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dGtxJ-0000j6-V2 for bug-gnu-emacs@gnu.org; Fri, 02 Jun 2017 17:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Jun 2017 21:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27191 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27191-submit@debbugs.gnu.org id=B27191.14964382562760 (code B ref 27191); Fri, 02 Jun 2017 21:18:01 +0000 Original-Received: (at 27191) by debbugs.gnu.org; 2 Jun 2017 21:17:36 +0000 Original-Received: from localhost ([127.0.0.1]:51975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGtwt-0000iS-VT for submit@debbugs.gnu.org; Fri, 02 Jun 2017 17:17:36 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:49974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGtwq-0000iD-Be for 27191@debbugs.gnu.org; Fri, 02 Jun 2017 17:17:34 -0400 Original-Received: from rosalinde ([83.135.25.240]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MZCUG-1dbjeT109c-00KufP for <27191@debbugs.gnu.org>; Fri, 02 Jun 2017 23:17:25 +0200 In-Reply-To: <87zidqq0n3.fsf@rosalinde> (Stephen Berman's message of "Fri, 02 Jun 2017 10:01:04 +0200") X-Provags-ID: V03:K0:pSJYWK4e1ZZ1POOpf7UClnl3mQZwjaWzboKCqTFhTt+7qQlL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gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133175 Archived-At: On Fri, 02 Jun 2017 10:01:04 +0200 Stephen Berman wrote: > On Thu, 01 Jun 2017 22:46:15 +0200 Stephen Berman wrote: > >> 0. emacs -Q >> 1. C-x C-f >> ~/foo/bar/very/long/file/name/that/overflows/minibuffer/window/line/when/displayed >> >> 2. C-x C-f >> => The file name entered in step 1 appears in the minibuffer, with point >> on the "w" of "when" (i.e., column 80, the end of the visual line). >> >> If at step 2 instead of you type `M-p', then point is at the end of >> the file name in the minibuffer. This is what I expected for too. >> >> The result with is due to the fix for bug#22544. In the bug thread >> (http://lists.gnu.org/archive/html/bug-gnu-emacs/2016-02/msg00357.html), >> the above problem was noted: >> >>> > Can't we special-case a line that isn't broken into several visual >>> > lines, and put the cursor at the end of such lines only? That'd be >>> > the best. >>> >>> The problem here is that like bash and other shells with histories do, >>> we need to put the cursor at the end of the previous history element >>> so the user can start editing it immediately (usually deleting the chars >>> from the end of the logical line). OTOH, a subsequent should >>> continue navigating the history and put the next previous element to the >>> minibuffer. But then can't be used to move between visual lines. >>> This is a lose-lose situation, unless we'll find some clever DWIM. >> >> The attached patch isn't particularly clever, but (unless I've >> overlooked something) > > Oops, I did. I also overlooked that on such a long line in the minibuffer moves visually to the overflowing part of the element, rather than immediately going to the next history element; this is likewise fixed by the corresponding patch to next-line-or-history-element: diff --git a/lisp/simple.el b/lisp/simple.el index ea3a495fbc..7914fc1fae 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2106,7 +2106,16 @@ next-line-or-history-element (current-column))))) (condition-case nil (with-no-warnings - (next-line arg)) + ;; If the history element consists of a single line longer + ;; than window-width, move by logical lines to hit + ;; end-of-buffer immediately and get the next history + ;; element. Otherwise, move by visual lines. + (if (and (save-excursion + (end-of-line) + (> (current-column) (window-width))) + (= (line-number-at-pos) 1)) + (next-logical-line arg) + (next-line arg))) (end-of-buffer ;; Restore old position since `line-move-visual' moves point to ;; the end of the line when it fails to go to the next line. (Unlike with previous-line-or-history-element, with without next-line-or-history-element I don't see any difference with or without an explicit call to end-of-line at the end.) Steve Berman