unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22098: 25.0.50; visual-line-mode and invisible text causes cursor to jump
@ 2015-12-05 20:47 dunni
  2015-12-06  3:42 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: dunni @ 2015-12-05 20:47 UTC (permalink / raw)
  To: 22098

[-- Attachment #1: Type: text/plain, Size: 567 bytes --]


emacs -Q output.txt
M-x visual-line-mode
;; Scroll just after the long line of text in the middle of the screen,
;; then position the cursor at the first character at that visual line.
C-M-: (add-text-properties (point) (1+ (point)) '(invisible t))
next-line
recenter-top-bottom
previous-line

The cursor should jump to the top of the screen.  This isn't always the
case, as it sometimes moves to the bottom.  It seems to only happen when
the window needs to be repositioned.

As you may be able to tell from the output below, I'm running from the
emacs-25 branch.


[-- Attachment #2: output.txt --]
[-- Type: text/plain, Size: 380 bytes --]

Insert a bunch of text right here







a bunch more right here


maybe some here





A bunch of text right here that takes up the entire line in the window.  A bunch of text right here that takes up the entire line in the window.  A bunch of text right here that takes up the entire line in the window.


More text here





More text here





Some text here for good measure

[-- Attachment #3: Type: text/plain, Size: 2901 bytes --]





In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.5)
 of 2015-12-02
Repository revision: 4d10a7d467b6b0927036387c0d4849b2f40abcee
Windowing system distributor 'The X.Org Foundation', version 11.0.11800000
System Description:	Parabola GNU/Linux-libre

Configured using:
 'configure --prefix=/home/skolar/source/src'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Text

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Recent messages:
Wrote /home/skolar/.emacs.d/output.txt
Visual-Line mode enabled in current buffer
Undo!
t
0 (#o0, #x0, ?\C-@)
Saving file /home/skolar/.emacs.d/output.txt...
Wrote /home/skolar/.emacs.d/output.txt
Quit
Making completion list...
next-line: End of buffer

Load-path shadows:
None found.

Features:
(seq byte-opt gv bytecomp byte-compile cconv cl-extra wid-edit
descr-text pp shadow sort gnus-util mail-extr emacsbug message dired
format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib
mail-prsvr mail-utils time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
dbusbind inotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 91128 16179)
 (symbols 48 19947 6)
 (miscs 40 74 221)
 (strings 32 15597 7343)
 (string-bytes 1 469318)
 (vectors 16 12823)
 (vector-slots 8 432837 9867)
 (floats 8 163 161)
 (intervals 56 244 11)
 (buffers 976 15)
 (heap 1024 46195 1614))

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22098: 25.0.50; visual-line-mode and invisible text causes cursor to jump
  2015-12-05 20:47 bug#22098: 25.0.50; visual-line-mode and invisible text causes cursor to jump dunni
@ 2015-12-06  3:42 ` Eli Zaretskii
  2015-12-06  5:28   ` Ian Dunn
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2015-12-06  3:42 UTC (permalink / raw)
  To: dunni; +Cc: 22098

> From: dunni@gnu.org
> Date: Sat, 05 Dec 2015 15:47:00 -0500
> 
> emacs -Q output.txt
> M-x visual-line-mode
> ;; Scroll just after the long line of text in the middle of the screen,
> ;; then position the cursor at the first character at that visual line.
> C-M-: (add-text-properties (point) (1+ (point)) '(invisible t))
> next-line
> recenter-top-bottom
> previous-line
> 
> The cursor should jump to the top of the screen.  This isn't always the
> case, as it sometimes moves to the bottom.  It seems to only happen when
> the window needs to be repositioned.

I seem to be unable to reproduce this on my system.  Maybe I didn't
understand the exact place where to put the invisible property.  What
is the value of point there?

Also, is it really necessary to invoke the commands via M-x, or do you
see the same problem when you use C-n, C-l, and C-p instead?

Finally, your build is slightly outdated, so perhaps see if the
problem persists with the current emacs-25 branch.

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22098: 25.0.50; visual-line-mode and invisible text causes cursor to jump
  2015-12-06  3:42 ` Eli Zaretskii
@ 2015-12-06  5:28   ` Ian Dunn
  2015-12-06 17:34     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Dunn @ 2015-12-06  5:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 22098

Eli Zaretskii <eliz@gnu.org> writes:

>
> I seem to be unable to reproduce this on my system.  Maybe I didn't
> understand the exact place where to put the invisible property.  What
> is the value of point there?
>

Move point to the start of logical line 19, then move point one visual
line up.  Set that character to be invisible, then move point back to
the start of logical line 19.  Re-position the window twice, then move
point up one visible line.

M-g M-g 19
C-p
C-M-: (add-text-properties (point) (1+ (point)) '(invisible t))
C-n
C-l C-l
C-p

> Also, is it really necessary to invoke the commands via M-x, or do you
> see the same problem when you use C-n, C-l, and C-p instead?
>

I try not to assume that everyone has the same key-bindings as me, so I
thought it might help to use the actual command names.  As far as I can
tell, it makes no difference.

> Finally, your build is slightly outdated, so perhaps see if the
> problem persists with the current emacs-25 branch.
>
> Thanks.

I updated my build to the most recent version of the emacs-25 branch,
but the problem still persists.  I forgot to mention in my original
report that this seems similar to bug #17047
(https://lists.gnu.org/archive/html/bug-gnu-emacs/2014-03/msg00804.html).
It looks like the old bug addressed the problem with forward-char and
backward-char.  I've checked with next-line, but I've never seen it
happen before.  I only ever see this problem with previous-line.

Thanks for your quick response.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22098: 25.0.50; visual-line-mode and invisible text causes cursor to jump
  2015-12-06  5:28   ` Ian Dunn
@ 2015-12-06 17:34     ` Eli Zaretskii
  2015-12-09  1:33       ` Ian Dunn
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2015-12-06 17:34 UTC (permalink / raw)
  To: Ian Dunn; +Cc: 22098

> From: Ian Dunn <dunni@gnu.org>
> Cc: 22098@debbugs.gnu.org
> Date: Sun, 06 Dec 2015 00:28:57 -0500
> 
> M-g M-g 19
> C-p
> C-M-: (add-text-properties (point) (1+ (point)) '(invisible t))
> C-n
> C-l C-l
> C-p

Thanks.  With this recipe, I do see some unusual behavior of the
cursor, but not the one you described.  On my system, the cursor stays
at its position before the final C-p, then, a fraction of second
later, jumps to its correct position.  It doesn't stay at the top line
of the window.

> > Also, is it really necessary to invoke the commands via M-x, or do you
> > see the same problem when you use C-n, C-l, and C-p instead?
> 
> I try not to assume that everyone has the same key-bindings as me, so I
> thought it might help to use the actual command names.

Yes, but you should be aware that this might make a difference for
redisplay problems: typing M-x causes a mildly thorough redisplay, so
it might obscure some problems and cause some others.  That's why I
asked.

> I forgot to mention in my original report that this seems similar to
> bug #17047
> (https://lists.gnu.org/archive/html/bug-gnu-emacs/2014-03/msg00804.html).
> It looks like the old bug addressed the problem with forward-char
> and backward-char.  I've checked with next-line, but I've never seen
> it happen before.  I only ever see this problem with previous-line.

No, that's a different problem.  The problem discussed here happens
because point moves outside the window to the place that's invisible.
By contrast, bug #17047 was about a situation where the goal position
was visible in the window at all times.

Anyway, I fixed the problem I see here in commit cca5629 on the
emacs-25 branch.  Please see if your problem is solved by that change.

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22098: 25.0.50; visual-line-mode and invisible text causes cursor to jump
  2015-12-06 17:34     ` Eli Zaretskii
@ 2015-12-09  1:33       ` Ian Dunn
       [not found]         ` <83fuzbbimh.fsf@gnu.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Dunn @ 2015-12-09  1:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 22098

[-- Attachment #1: Type: text/plain, Size: 2572 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> I try not to assume that everyone has the same key-bindings as me, so I
>> thought it might help to use the actual command names.
>
> Yes, but you should be aware that this might make a difference for
> redisplay problems: typing M-x causes a mildly thorough redisplay, so
> it might obscure some problems and cause some others.  That's why I
> asked.
>

I did not know that.  Thanks for the tip.

> Anyway, I fixed the problem I see here in commit cca5629 on the
> emacs-25 branch.  Please see if your problem is solved by that change.
>
> Thanks.

Thanks once again for the quick response, and my apologies for my
sluggish response.

That fixed the problem in that sample I gave to you, but I noticed a
similar problem that I just figured out how to replicate:

  emacs -Q output.txt
  visual-line-mode
  global-hl-line-mode
  M-g M-g 19
  C-p
  C-M-: (add-text-properties (point) (1+ (point)) '(invisible t))
  C-p
  C-l C-l
  C-n C-n
  C-p

What I see happen is point jump to exactly half-way down the window.
This only seems to happen when the invisible text is on the second
visual line of the window, but the start of the line isn't the first.

To demonstrate this, here is what I see when I encounter the bug:

words are formatted and printed--emacs outshines all other editing software in approximately the same
way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes
everything else vanish.

I make the 'w' in "way" invisible (since making the 'e' in "everything"
invisible causes that word to jump to the previous visual line), and
re-position the window such that "words" is the first visible word in
the window (So those three lines are the first three visual lines of the
window).  Then, I move point down two visual lines, and then try to move
it back up so it is over the word "ay" (way with an invisible "w").
When I do, the cursor (and I assume point) immediately jumps to one line
above the middle of the window.  I verified this last bit by moving the
cursor in an adjacent window to the exact center, and comparing.  The
cursor in the first window appears to be exactly one line above center.

Also, it only happens when global-hl-line-mode is also active.

If the involvement of global-hl-line-mode in this constitutes a separate
bug, then just let me know so I can file another report.

I updated output.txt with with additional (actual) text, so to verify
that we are in fact using the same file, I've attached it again.

Once again, thank you for your help.

Ian Dunn


[-- Attachment #2: output.txt --]
[-- Type: text/plain, Size: 479 bytes --]

Insert a bunch of text right here







a bunch more right here


maybe some here





  If you are a professional writer--i.e., if someone else is getting paid to worry about how your words are formatted and printed--emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish.


More text here





More text here





Some text here for good measure

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22098: 25.0.50; visual-line-mode and invisible text causes cursor to jump
       [not found]         ` <83fuzbbimh.fsf@gnu.org>
@ 2015-12-10  1:13           ` Ian Dunn
  2015-12-10 16:40             ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Dunn @ 2015-12-10  1:13 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 22098

Eli Zaretskii <eliz@gnu.org> writes:

>
> The evil hl-line-mode, sigh...
>
> Fixed in commit d75849e on the emacs-25 branch.  Thanks for the
> recipe.
>

Fix verified.  Thanks for all of your help, Eli.

Ian





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#22098: 25.0.50; visual-line-mode and invisible text causes cursor to jump
  2015-12-10  1:13           ` Ian Dunn
@ 2015-12-10 16:40             ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2015-12-10 16:40 UTC (permalink / raw)
  To: Ian Dunn; +Cc: 22098-done

> From: Ian Dunn <dunni@gnu.org>
> Cc: 22098@debbugs.gnu.org
> Date: Wed, 09 Dec 2015 20:13:43 -0500
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >
> > The evil hl-line-mode, sigh...
> >
> > Fixed in commit d75849e on the emacs-25 branch.  Thanks for the
> > recipe.
> >
> 
> Fix verified.  Thanks for all of your help, Eli.

Thanks, closing.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-12-10 16:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-05 20:47 bug#22098: 25.0.50; visual-line-mode and invisible text causes cursor to jump dunni
2015-12-06  3:42 ` Eli Zaretskii
2015-12-06  5:28   ` Ian Dunn
2015-12-06 17:34     ` Eli Zaretskii
2015-12-09  1:33       ` Ian Dunn
     [not found]         ` <83fuzbbimh.fsf@gnu.org>
2015-12-10  1:13           ` Ian Dunn
2015-12-10 16:40             ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

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).