all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org, Juri Linkov <juri@linkov.net>
Subject: Re: UP and DOWN with multi-line minibuffer history
Date: Mon, 14 Dec 2015 10:25:20 +0100	[thread overview]
Message-ID: <8761019ybj.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <83lh8y5q3k.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 13 Dec 2015 17:24:15 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Juri Linkov <juri@linkov.net>
>> Cc: emacs-devel@gnu.org
>> 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.

Really?

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 <eliz@gnu.org>
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 <storm@cua.dk>
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



  parent reply	other threads:[~2015-12-14  9:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-12 14:19 UP and DOWN with multi-line minibuffer history Eli Zaretskii
2015-12-12 15:03 ` Dmitry Gutov
2015-12-12 23:04   ` John Wiegley
2015-12-12 22:47 ` Eric Hanchrow
2015-12-12 23:20 ` Juri Linkov
2015-12-13 15:24   ` Eli Zaretskii
2015-12-14  0:07     ` Juri Linkov
2015-12-14  3:39       ` Eli Zaretskii
2015-12-14 23:45         ` Juri Linkov
2015-12-15  3:37           ` Eli Zaretskii
2015-12-16  0:32             ` Juri Linkov
2015-12-16  1:33               ` Dmitry Gutov
2015-12-17  0:45                 ` Juri Linkov
2015-12-16  2:02               ` Yuri Khan
2015-12-16  6:29                 ` Drew Adams
2015-12-17  0:49                 ` Juri Linkov
2015-12-15  3:43         ` Dmitry Gutov
2015-12-15 15:45           ` Eli Zaretskii
2015-12-14  9:25     ` David Kastrup [this message]
2015-12-14 16:00       ` Eli Zaretskii
2015-12-14 16:41         ` David Kastrup
2015-12-14 17:03           ` Eli Zaretskii
     [not found] <CABr8ebZDmnsCKyBnzU3sSDHefJ2_3uC4Omwg=N4qQ8h80vTxpw@mail.gmail.com>
2015-12-13  3:31 ` Eli Zaretskii
2015-12-13  5:38   ` Anders Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761019ybj.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.