all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 22544@debbugs.gnu.org
Subject: bug#22544: 25.0.90; Long history items cause surprising positioning of cursor in minibuffer
Date: Thu, 04 Feb 2016 18:28:55 +0200	[thread overview]
Message-ID: <831t8sxwvs.fsf@gnu.org> (raw)
In-Reply-To: <87d1sd1du7.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 04 Feb 2016 02:49:04 +0200)

> From: Juri Linkov <juri@linkov.net>
> Cc: 22544@debbugs.gnu.org
> Date: Thu, 04 Feb 2016 02:49:04 +0200
> 
> > Still as expected.  Press <UP> once more, resulting in:
> >
> >   Output message to mail file (default FOO): ~/foo/ba!r/very/long/file/name/that/overflows/minibuffer/window/line/when/displayed
> >
> > This is somewhat unexpected, because the column of the cursor looks
> > random -- it is neither the same as in previous display, nor related
> > to anything else I can think of.
> 
> Sorry, I don't understand: it's unexpected that the cursor jumps
> to the previous visual line (this is because of line-move-visual),
> or an invalid column position on the previous visual line?

The latter.

> > Now press <UP> one more time, and observe this result:
> >
> >   Output message to mail file (default FOO): ~/shorte!r/file/name
> >
> > This is even less expected -- why isn't the cursor at the end of the
> > file name, even though it is short enough to display entirely on a
> > single screen line?
> 
> This is because it keeps the last column before navigating
> to the previous history element.  The last column was near
> the beginning of the top visual line.

But if a long line is not in history, then the cursor is not
positioned on the same column, it is positioned at the end of the
history item.  So this behavior is inconsistent, and depends on
whether long items are or aren't in the history.

> Do you think we should disable line-move-visual in the minibuffer?
> I tried to do this like below.  This might help to avoid these problems,
> but I'm not sure.
> 
>    (let ((minibuffer-setup-hook (lambda () (setq-local line-move-visual nil)))
> 	 (default-file "~/rmail/FOO")
> 	 (file-name-history
> 	  '("~/rmail/FOOBAR"
> 	    "~/foo/bar/very/long/file/name/that/overflows/minibuffer/window/line/when/displayed"
> 	    "~/shorter/file/name")))
>      (read-file-name
>       (concat "Output message to mail file (default "
> 	      (file-name-nondirectory default-file)
> 	      "): ")
>       (file-name-directory default-file)
>       (abbreviate-file-name default-file)))

This helps to avoid the problem, but doesn't it defeat the new feature
whereby <UP> moves by visual rather than by logical lines?  The above
simply reverts to pre-Emacs 25 behavior, AFAICS.

Thanks.





  reply	other threads:[~2016-02-04 16:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 16:32 bug#22544: 25.0.90; Long history items cause surprising positioning of cursor in minibuffer Eli Zaretskii
2016-02-04  0:49 ` Juri Linkov
2016-02-04 16:28   ` Eli Zaretskii [this message]
2016-02-05  0:42     ` Juri Linkov
2016-02-05  9:53       ` Eli Zaretskii
2016-02-06  0:52         ` Juri Linkov
2016-02-06  7:45           ` Eli Zaretskii
2016-02-07  0:49             ` Juri Linkov
2016-02-07 19:29               ` Eli Zaretskii
2016-02-08  0:40                 ` Juri Linkov
2016-02-08 18:23                   ` Eli Zaretskii
2016-02-10  0:32                     ` Juri Linkov

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=831t8sxwvs.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=22544@debbugs.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.