Hello, The line-prefix text property set by org-indent-mode sometimes vanishes when typing near a line where an overlay is applied. To reproduce: - emacs -Q - C-x C-f repro.org - M-x org-indent-mode - M-: (insert "* heading\ntext") - M-: (let ((ov (make-overlay (point-at-bol) (point-at-bol))) (val (propertize " " 'display '((left-fringe right-triangle))))) (overlay-put ov 'before-string val)) - RET - a When "a" is inserted, org-indent-mode's line-prefix disappears on the *previous* line ("text"). It remains gone as long as I type self-inserting characters, until - I type certain commands, e.g. RET or C-j, or - I insert a closing delimiter that makes blink-paren-post-self-insert-function blink the corresponding opening delimiter, e.g. ')' or ']'. Then the line-prefix shows up again. This recipe is simplified; I originally found this bug in Org files under version control with diff-hl-flydiff-mode enabled. When typing in new content, the preceding line is shoved to the left until I stop typing; after diff-hl-flydiff-delay, diff-hl's idle timer kicks in and updates its overlay, which as a side-effect makes org-indent-mode's line-prefix come back up. See [1] for my original bug report to diff-hl and some crude "analysis". I'm clearly out of my depth; at least I hope I used the correct terms to describe the symptoms I've observed. Let me know if there is anything I can do to help debug this. Thank you for your time. [1] https://github.com/dgutov/diff-hl/issues/142 In GNU Emacs 28.0.50 (build 21, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2020-05-18 built on my-little-tumbleweed Repository revision: b1fe27d77db8f819641231ca46725f3eed0b4d9b Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: openSUSE Tumbleweed Configured using: 'configure --with-xwidgets --with-cairo' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS JSON PDUMPER LCMS2 GMP Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LC_TIME: en_GB.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=local locale-coding-system: utf-8-unix
> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Date: Thu, 28 May 2020 21:54:09 +0200
> Cc: emacs-orgmode@gnu.org, Dmitry Gutov <dgutov@yandex.ru>
>
> - emacs -Q
> - C-x C-f repro.org
> - M-x org-indent-mode
> - M-: (insert "* heading\ntext")
> - M-:
> (let ((ov (make-overlay (point-at-bol) (point-at-bol)))
> (val (propertize " " 'display '((left-fringe right-triangle)))))
> (overlay-put ov 'before-string val))
> - RET
> - a
>
> When "a" is inserted, org-indent-mode's line-prefix disappears on the
> *previous* line ("text"). It remains gone as long as I type
> self-inserting characters, until
>
> - I type certain commands, e.g. RET or C-j, or
>
> - I insert a closing delimiter that makes
> blink-paren-post-self-insert-function blink the corresponding opening
> delimiter, e.g. ')' or ']'.
>
> Then the line-prefix shows up again.
In fact, it's enough to type "M-x". Which is a clear sign that some
redisplay optimization kicks in where it shouldn't. And indeed,
setting inhibit-try-window-id non-nil solves the problem.
I will look into this when I have time, thanks for an easy reproducer.
> Date: Fri, 29 May 2020 10:12:27 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 41584@debbugs.gnu.org, dgutov@yandex.ru
>
> In fact, it's enough to type "M-x". Which is a clear sign that some
> redisplay optimization kicks in where it shouldn't. And indeed,
> setting inhibit-try-window-id non-nil solves the problem.
>
> I will look into this when I have time, thanks for an easy reproducer.
Should be fixed now on the master branch.
Eli Zaretskii <eliz@gnu.org> writes: > Should be fixed now on the master branch. Thanks a lot! I'm sorry I didn't notice it earlier, but I may have found another mole for you to whack; starting with the same recipe: > - emacs -Q > - C-x C-f repro.org > - M-x org-indent-mode > - M-: (insert "* heading\ntext") > - M-: > (let ((ov (make-overlay (point-at-bol) (point-at-bol))) > (val (propertize " " 'display '((left-fringe right-triangle))))) > (overlay-put ov 'before-string val)) This time, instead of hitting RET, insert a pair of parentheses, and wait blink-matching-delay seconds until the opening parenthesis stops being highlighted. Before and after your fix, the line-prefix disappears until I enter another command.
> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Cc: 41584@debbugs.gnu.org, dgutov@yandex.ru
> Date: Fri, 29 May 2020 20:11:40 +0200
>
> This time, instead of hitting RET, insert a pair of parentheses, and
> wait blink-matching-delay seconds until the opening parenthesis stops
> being highlighted. Before and after your fix, the line-prefix
> disappears until I enter another command.
Fixed.
Eli Zaretskii <eliz@gnu.org> writes:
> Fixed.
AFAICT you've scared the moles away, so I'll boldly close this report.
Thanks a lot for the efficient whacking!
(I guess xdisp.c is something we won't to touch with a 10-foot pole on
the release branch, especially for a bug that users have lived with for
so long?)
> From: Kévin Le Gouguec <kevin.legouguec@gmail.com>
> Cc: 41584-done@debbugs.gnu.org, dgutov@yandex.ru
> Date: Fri, 29 May 2020 22:32:11 +0200
>
> (I guess xdisp.c is something we won't to touch with a 10-foot pole on
> the release branch, especially for a bug that users have lived with for
> so long?)
Exactly.