all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Milan Stanojević" <milanst@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: recenter and visual-line-mode
Date: Wed, 8 Apr 2015 19:29:48 -0400	[thread overview]
Message-ID: <CAKR7PS9i9em3H6Nec75JfTLzSWEHyECCisn1PXy9_cWxYO_CGw@mail.gmail.com> (raw)
In-Reply-To: <CAKR7PS9o_FyCQKb8zUhdh_9ztjpkTrQuQUZE7n4r3dfFB7+WeA@mail.gmail.com>

Btw, I get slightly different output if I ran emacs in terminal, i.e.
emacs -Q -nw
A was on 1, after recenter it is on 1
B was on 1, after recenter it is on 1
C was on 1, after recenter it is on 1
D was on 1, after recenter it is on 0
E was on 1, after recenter it is on 0
F was on 1, after recenter it is on 0
G was on 1, after recenter it is on 0
H was on 1, after recenter it is on 0

which I think confirms my suspicion because in terminal mode the last
character on the long line is backslash, so D is moved down, whereas
in graphical mode instead of backslash the fringe is used as an
indicator that logical line is too long.

On Wed, Apr 8, 2015 at 3:59 PM, Milan Stanojević <milanst@gmail.com> wrote:
> Here is the elisp code illustrating the issue. Run "emacs -Q" and make
> sure your window manager won't mess up with size of the frame (e.g. if
> you are using xmonad like I am, just make the frame floating).
>
> Open the attached file and do M-x eval-buffer.
>
> I get the following output
> A was on 1, after recenter it is on 1
> B was on 1, after recenter it is on 1
> C was on 1, after recenter it is on 1
> D was on 1, after recenter it is on 1
> E was on 1, after recenter it is on 0
> F was on 1, after recenter it is on 0
> G was on 1, after recenter it is on 0
> H was on 1, after recenter it is on 0
>
> This shows that running (recenter 0) at different points of the same
> screen line leads to different behavior and it seems that the
> difference comes from where the point would be without
> visual-line-mode. I think in all cases the point should be at the top
> of the line, but that is not the case for ABCD.
>
>
>
>
> On Wed, Apr 8, 2015 at 2:43 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>> From: Milan Stanojević <milanst@gmail.com>
>>> Date: Tue, 7 Apr 2015 16:14:59 -0400
>>>
>>> With visual-line-mode on, running (recenter 0) doesn't always put the
>>> point on the top-most line in the window.
>>>
>>> I experimented a bit and it seems that (recenter 0) doesn't work if
>>> the point is on the portion of the word that was moved down because of
>>> word-wrapping.
>>>
>>> For example, I have word "foobar" where "bar" can't fit on the line.
>>> With visual-line-mode off (and truncate-lines nil), "foo" will be one
>>> visual line and then "bar" on the next. If I turn on visual-line-mode,
>>> the whole "foobar" would move to the next visual line. If I then run
>>> (recenter 0) while point is inside "foo", the lines will move such
>>> that point ends up on line 2, but if I do it while the point is inside
>>> "bar" then the point will end up on line 1. I think the correct
>>> behavior would be to move to line 1 always.
>>>
>>> Is this a bug?
>>>
>>> I'm using emacs 24.4.1 with Motif toolkit.
>>
>> I cannot reproduce this, not in "emacs -Q".  Can you provide a
>> complete self-contained recipe for reproducing the problem, starting
>> from "emacs -Q"?
>>
>>



  reply	other threads:[~2015-04-08 23:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07 20:14 recenter and visual-line-mode Milan Stanojević
2015-04-08  6:43 ` Eli Zaretskii
2015-04-08 19:59   ` Milan Stanojević
2015-04-08 23:29     ` Milan Stanojević [this message]
2015-04-09  8:30     ` Eli Zaretskii
2015-04-10 10:13       ` Eli Zaretskii
2015-04-10 15:38         ` Milan Stanojević
2015-04-10 17:37           ` Eli Zaretskii

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=CAKR7PS9i9em3H6Nec75JfTLzSWEHyECCisn1PXy9_cWxYO_CGw@mail.gmail.com \
    --to=milanst@gmail.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.