[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UP and DOWN with multi-line minibuffer history

From: David Kastrup
Subject: Re: UP and DOWN with multi-line minibuffer history
Date: Mon, 14 Dec 2015 10:25:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Juri Linkov <address@hidden>
>> Cc: address@hidden
>> Date: Sun, 13 Dec 2015 01:20:49 +0200
>> > I think it would be more consistent, including with how
>> > line-move-visual behaves in normal buffers, if UP ended up in the last
>> > line of the previous item.  WDYT?
>> The initial implementation of this feature was like you described above.
>> But later I received complaints off-list that convinced me to open
>> bug#19824 with better implementation to address the inconvenience of
>> navigating through the multi-line minibuffer history: for backward-compatible
>> behavior we need every UP in the sequence move to a previous history item.
>> This can be achieved when UP places the cursor at the top line of a
>> multi-line history item, ready for going to the next previous item with
>> successive UP.
> Sorry, I don't understand why supporting goal-column must have this
> side effect.  In a normal buffer, we do support goal-column (in the
> visual-line sense), and still we don't jump to the firs screen line of
> a long logical line.


>From simple.el:

(defun line-move (arg &optional noerror to-end try-vscroll)
  "Move forward ARG lines.
If NOERROR, don't signal an error if we can't move ARG lines.
TO-END is unused.
TRY-VSCROLL controls whether to vscroll tall lines: if either
`auto-window-vscroll' or TRY-VSCROLL is nil, this function will
not vscroll."
      (if (and line-move-visual
               ;; Display-based column are incompatible with goal-column.
               (not goal-column)

A bit of git-blame work reveals that this was introduced by a certain
Eli Zaretskii in:

commit 064f328a6ac90698c719b6eace60d6f4c90e3f08
Author: Eli Zaretskii <address@hidden>
Date:   Fri Sep 16 20:15:16 2011 +0300

    Fix bug #971 with next/previous-line when goal-column is set.
     lisp/simple.el (line-move): If goal-column is set, move by logical
     lines, not by display lines.
     (next-line, previous-line, goal-column, line-move-visual): Doc fix
     to reflect the above change.

We also have

commit 295f6616401967b2fae6671a5d2ae36a287576e9
Author: Kim F. Storm <address@hidden>
Date:   Sun Mar 13 23:20:49 2005 +0000

    (next-line, previous-line): Add optional try-vscroll
    arg to recognize interactive use.  Pass it on to line-move.
    (line-move): Don't perform auto-window-vscroll when defining or
    executing keyboard macro to ensure consistent behaviour.

from a time where people actually bothered about getting consistently
working keyboard macros, which contains the section:

 ;; Perform vertical scrolling of tall images if necessary.
+;; Don't vscroll in a keyboard macro.
 (defun line-move (arg &optional noerror to-end try-vscroll)
-  (if (and auto-window-vscroll try-vscroll)
+  (if (and auto-window-vscroll try-vscroll
+          (not defining-kbd-macro)
+          (not executing-kbd-macro))
       (let ((forward (> arg 0))

David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]