* visual-line-mode produces erratic behaviour with text properties
@ 2016-07-01 5:30 Paul Rankin
2016-07-01 7:55 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Paul Rankin @ 2016-07-01 5:30 UTC (permalink / raw)
To: help-gnu-emacs
Enabling visual-line-mode and adding line-prefix and wrap-prefix properties to a long paragraph of text produces erratic navigational behaviour. Can anyone else reproduce?
To reproduce:
1. $ emacs -Q
2. insert a long paragraph of text
M-: (url-insert-file-contents "https://gist.githubusercontent.com/rnkn/d5987c3495901e4950782f6648846e4e/raw/c22074e8f0940f6ec9c8b729f04567dc50664823/loren-ipsum.txt")
3. turn on visual line mode
M-: (visual-line-mode 1)
4. add text properties
M-: (add-text-properties (point-min) (point-max) '(line-prefix (space :align-to 10) wrap-prefix (space :align-to 10)))
5. C-n past window length and up and around.
Expected results:
Navigation should continue by visual line.
Actual results:
Navigational behaviour becomes erratic. Point will no long move with visual lines, instead jumping to different columns. This is more pronounced with a window 80 columns or less.
Configuration:
GNU Emacs 24.5.1 (x86_64-apple-darwin15.5.0, NS apple-appkit-1404.47) of 2016-06-26
OS X 10.11.4 (15E65)
MacBook Pro (Retina, 15-inch, Mid 2014)
2.2 GHz Intel Core i7
16 GB 1600 MHz DDR3
Intel Iris Pro 1536 MB
--
Paul W. Rankin
www.paulwrankin.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: visual-line-mode produces erratic behaviour with text properties
2016-07-01 5:30 visual-line-mode produces erratic behaviour with text properties Paul Rankin
@ 2016-07-01 7:55 ` Eli Zaretskii
2016-07-01 8:29 ` Paul Rankin
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2016-07-01 7:55 UTC (permalink / raw)
To: help-gnu-emacs
> From: Paul Rankin <hello@paulwrankin.com>
> Date: Fri, 01 Jul 2016 15:30:25 +1000
>
> 1. $ emacs -Q
>
> 2. insert a long paragraph of text
> M-: (url-insert-file-contents "https://gist.githubusercontent.com/rnkn/d5987c3495901e4950782f6648846e4e/raw/c22074e8f0940f6ec9c8b729f04567dc50664823/loren-ipsum.txt")
>
> 3. turn on visual line mode
> M-: (visual-line-mode 1)
>
> 4. add text properties
> M-: (add-text-properties (point-min) (point-max) '(line-prefix (space :align-to 10) wrap-prefix (space :align-to 10)))
>
> 5. C-n past window length and up and around.
>
> Expected results:
>
> Navigation should continue by visual line.
>
> Actual results:
>
> Navigational behaviour becomes erratic. Point will no long move with visual lines, instead jumping to different columns. This is more pronounced with a window 80 columns or less.
Not quite accurate: the erratic behavior begins only when point
reaches the end of the first window-full.
Please report this as a bug, using "M-x report-emacs-bug RET".
Super-long lines such as this one slow down the display engine, and
there are various redisplay optimizations to try to countermand that,
so perhaps this is one of them.
In general, my recommendation is to stay away of such long lines in
Emacs.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: visual-line-mode produces erratic behaviour with text properties
2016-07-01 7:55 ` Eli Zaretskii
@ 2016-07-01 8:29 ` Paul Rankin
2016-07-01 9:29 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Paul Rankin @ 2016-07-01 8:29 UTC (permalink / raw)
To: help-gnu-emacs
On Fri, 1 Jul 2016, at 05:55 PM, Eli Zaretskii wrote:
> Super-long lines such as this one slow down the display engine, and
> there are various redisplay optimizations to try to countermand that,
> so perhaps this is one of them.
Do you mean Emacs has redisplay optimisations that may be causing the erratic navigation?
Or, are there redisplay optimisations I can implement myself in an affected major mode to work around this?
> In general, my recommendation is to stay away of such long lines in
> Emacs.
I can't control this for users of the major mode. It's an edge case, but still.
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: visual-line-mode produces erratic behaviour with text properties
2016-07-01 8:29 ` Paul Rankin
@ 2016-07-01 9:29 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2016-07-01 9:29 UTC (permalink / raw)
To: help-gnu-emacs
> From: Paul Rankin <hello@paulwrankin.com>
> Date: Fri, 01 Jul 2016 18:29:40 +1000
>
> On Fri, 1 Jul 2016, at 05:55 PM, Eli Zaretskii wrote:
> > Super-long lines such as this one slow down the display engine, and
> > there are various redisplay optimizations to try to countermand that,
> > so perhaps this is one of them.
>
> Do you mean Emacs has redisplay optimisations that may be causing the erratic navigation?
Yes, at least in principle.
> Or, are there redisplay optimisations I can implement myself in an affected major mode to work around this?
That's not the way to deal with these problems. If some redisplay
optimization causes incorrect display in some use case, it should be
disabled in that use case. IOW, it's a bug that needs to be fixed,
not worked around in application code.
> > In general, my recommendation is to stay away of such long lines in
> > Emacs.
>
> I can't control this for users of the major mode. It's an edge case, but still.
That recommendation was mainly for end-users, not for developers. Of
course, if you can come up with an implementation that avoids long
lines, you as developer should prefer it, but I understand this is not
such a case.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-01 9:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-01 5:30 visual-line-mode produces erratic behaviour with text properties Paul Rankin
2016-07-01 7:55 ` Eli Zaretskii
2016-07-01 8:29 ` Paul Rankin
2016-07-01 9:29 ` Eli Zaretskii
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).