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. Here's the corrected patch: