GNU bug report logs - #72681
31.0.50; visual-wrap-prefix-mode interacts badly with plain lists in org-mode

Previous Next

Package: emacs;

Reported by: "Mark Hepburn" <mark <at> markhepburn.com>

Date: Sat, 17 Aug 2024 07:14:01 UTC

Severity: normal

Found in version 31.0.50

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72681 in the body.
You can then email your comments to 72681 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#72681; Package emacs. (Sat, 17 Aug 2024 07:14:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Mark Hepburn" <mark <at> markhepburn.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 17 Aug 2024 07:14:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Mark Hepburn" <mark <at> markhepburn.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50;
 visual-wrap-prefix-mode interacts badly with plain lists in org-mode
Date: Sat, 17 Aug 2024 12:21:45 +1000
[Message part 1 (text/plain, inline)]
--text follows this line--

The recently-merged visual-wrap-prefix-mode support for variable-pitch
fonts seems to interact badly with plain lists in org-mode, causing
visual artefacts.  I think it's to do with both plain lists and a
trailing blank line.  To reproduce, from emacs -Q:
* switch to a new buffer
* M-x org-mode
* Insert a couple of headings, with a plain list followed by a blank
line afterwards:
====================
* header

- item

* second header
====================
* M-x visual-wrap-prefix-mode
* This now renders for me like:
====================
* header

- item

  *  second header
====================
(The actual artefacts are even more pronounced for me in practice
because I have org-adapt-indentation set, so the second header is even
more visually indented)


In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.41, cairo version 1.18.0) of 2024-08-17 built on x1carbon
Repository revision: 909d1d02db1c11e1309316cba2a392e1456e6053
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101011
System Description: Ubuntu 24.04 LTS

Configured using:
'configure --with-native-compilation --without-mailutils
--with-xwidgets --with-tree-sitter --with-libsystemd'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG
LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER
PNG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
WEBP X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_AU.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Org

Minor modes in effect:
  visual-wrap-prefix-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-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
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr dabbrev emacsbug reposition compile tmm
visual-wrap oc-basic cl-extra help-mode org-element org-persist org-id
org-refile org-element-ast inline avl-tree generator ol-eww eww xdg
url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect
gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr
pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start
gnus-dbus dbus comp-run comp-common xml gnus-cloud nnimap nnmail
browse-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie generate-lisp-file url-domsuf url-util url-parse auth-source
cl-seq eieio eieio-core cl-macs json map byte-opt gv bytecomp
byte-compile url-vars mail-source utf7 nnoo parse-time gnus-spec
gnus-int gnus-range message sendmail mailcap yank-media puny rfc822 mml
mml-sec password-cache epa derived epg rfc6068 epg-config mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util
text-property-search mail-utils range mm-util mail-prsvr wid-edit
ol-docview doc-view filenotify jka-compr image-mode exif dired
dired-loaddefs ol-bibtex bibtex iso8601 ol-bbdb ol-w3m ol-doi
org-link-doi org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-src sh-script smie treesit executable ob-comint org-pcomplete
pcomplete comint ansi-osc ansi-color ring org-list org-footnote
org-faces org-entities time-date subr-x noutline outline icons
ob-emacs-lisp ob-core ob-eval org-cycle org-table ol rx org-fold
org-fold-core org-keys oc org-loaddefs thingatpt find-func cal-menu
calendar cal-loaddefs org-version org-compat org-macs format-spec
cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine 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
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads xwidget-internal dbusbind
inotify dynamic-setting system-font-setting font-render-setting cairo
gtk x-toolkit xinput2 x multi-tty move-toolbar make-network-process
native-compile emacs)

Memory information:
((conses 16 262343 58872) (symbols 48 21342 0) (strings 32 73561 4714)
(string-bytes 1 2291125) (vectors 16 35091)
(vector-slots 8 431581 22950) (floats 8 341 49) (intervals 56 427 0)
(buffers 992 17))
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72681; Package emacs. (Sat, 17 Aug 2024 07:21:01 GMT) Full text and rfc822 format available.

Message #8 received at 72681 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Mark Hepburn" <mark <at> markhepburn.com>, Jim Porter <jporterbugs <at> gmail.com>
Cc: 72681 <at> debbugs.gnu.org
Subject: Re: bug#72681: 31.0.50;
 visual-wrap-prefix-mode interacts badly with plain lists in org-mode
Date: Sat, 17 Aug 2024 10:19:28 +0300
> Date: Sat, 17 Aug 2024 12:21:45 +1000
> From: "Mark Hepburn" <mark <at> markhepburn.com>
> 
> The recently-merged visual-wrap-prefix-mode support for variable-pitch
> fonts seems to interact badly with plain lists in org-mode, causing
> visual artefacts.  I think it's to do with both plain lists and a
> trailing blank line.  To reproduce, from emacs -Q:
> * switch to a new buffer
> * M-x org-mode
> * Insert a couple of headings, with a plain list followed by a blank
> line afterwards:
> ====================
> * header
> 
> - item
> 
> * second header
> ====================
> * M-x visual-wrap-prefix-mode
> * This now renders for me like:
> ====================
> * header
> 
> - item
> 
>   *  second header
> ====================
> (The actual artefacts are even more pronounced for me in practice
> because I have org-adapt-indentation set, so the second header is even
> more visually indented)

Thanks.

Jim, could you please look into this?  Is visual-wrap-prefix-mode at
all supposed to be used in Org buffers?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72681; Package emacs. (Sat, 17 Aug 2024 20:32:01 GMT) Full text and rfc822 format available.

Message #11 received at 72681 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Mark Hepburn <mark <at> markhepburn.com>
Cc: 72681 <at> debbugs.gnu.org
Subject: Re: bug#72681: 31.0.50; visual-wrap-prefix-mode interacts badly with
 plain lists in org-mode
Date: Sat, 17 Aug 2024 13:29:45 -0700
[Message part 1 (text/plain, inline)]
On 8/17/2024 12:19 AM, Eli Zaretskii wrote:
> Jim, could you please look into this?  Is visual-wrap-prefix-mode at
> all supposed to be used in Org buffers?

Yes, I think 'visual-wrap-prefix-mode' should support Org buffers. It's 
probably one of the more useful text-based modes where 
'visual-wrap-prefix-mode' would be convenient.

It looks like this was just a small corner case in the visual-wrap code 
for aligning prefix lines that didn't account for Org-Mode's custom 
'adaptive-fill-function'. I've fixed this by being more careful to only 
apply the 'min-width' display property to a single logical line.

Mark, does the attached patch fix things for you? It looks like it works 
in my tests, but maybe you have some more complicated test cases you'd 
like to try to verify this.
[0001-Be-more-careful-about-aligning-prefix-lines-in-visua.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72681; Package emacs. (Sun, 18 Aug 2024 00:05:02 GMT) Full text and rfc822 format available.

Message #14 received at 72681 <at> debbugs.gnu.org (full text, mbox):

From: "Mark Hepburn" <mark <at> markhepburn.com>
To: "Jim Porter" <jporterbugs <at> gmail.com>, "Eli Zaretskii" <eliz <at> gnu.org>
Cc: 72681 <at> debbugs.gnu.org
Subject: Re: bug#72681: 31.0.50;
 visual-wrap-prefix-mode interacts badly with plain lists in org-mode
Date: Sun, 18 Aug 2024 10:02:57 +1000
[Message part 1 (text/plain, inline)]
Thanks Jim, nice work -- yes that seems to work perfectly again for all the problematic files I had before.

Cheers, Mark.

On Sun, Aug 18, 2024, at 6:29 AM, Jim Porter wrote:
> On 8/17/2024 12:19 AM, Eli Zaretskii wrote:
> > Jim, could you please look into this?  Is visual-wrap-prefix-mode at
> > all supposed to be used in Org buffers?
> 
> Yes, I think 'visual-wrap-prefix-mode' should support Org buffers. It's 
> probably one of the more useful text-based modes where 
> 'visual-wrap-prefix-mode' would be convenient.
> 
> It looks like this was just a small corner case in the visual-wrap code 
> for aligning prefix lines that didn't account for Org-Mode's custom 
> 'adaptive-fill-function'. I've fixed this by being more careful to only 
> apply the 'min-width' display property to a single logical line.
> 
> Mark, does the attached patch fix things for you? It looks like it works 
> in my tests, but maybe you have some more complicated test cases you'd 
> like to try to verify this.
> 
> *Attachments:*
>  • 0001-Be-more-careful-about-aligning-prefix-lines-in-visua.patch
[Message part 2 (text/html, inline)]

Reply sent to Jim Porter <jporterbugs <at> gmail.com>:
You have taken responsibility. (Sun, 18 Aug 2024 01:43:01 GMT) Full text and rfc822 format available.

Notification sent to "Mark Hepburn" <mark <at> markhepburn.com>:
bug acknowledged by developer. (Sun, 18 Aug 2024 01:43:02 GMT) Full text and rfc822 format available.

Message #19 received at 72681-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Mark Hepburn <mark <at> markhepburn.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 72681-done <at> debbugs.gnu.org
Subject: Re: bug#72681: 31.0.50; visual-wrap-prefix-mode interacts badly with
 plain lists in org-mode
Date: Sat, 17 Aug 2024 18:40:29 -0700
On 8/17/2024 5:02 PM, Mark Hepburn wrote:
> Thanks Jim, nice work -- yes that seems to work perfectly again for all 
> the problematic files I had before.

Great, thanks for checking. I've therefore merged this to the master 
branch as 135da3556bb. Closing this bug now.

(Though of course if you find any other issues with the new 
'visual-wrap-prefix-mode' code, just let me know and I'll try to fix it.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72681; Package emacs. (Sun, 18 Aug 2024 09:55:01 GMT) Full text and rfc822 format available.

Message #22 received at 72681-done <at> debbugs.gnu.org (full text, mbox):

From: "Mark Hepburn" <mark <at> markhepburn.com>
To: "Jim Porter" <jporterbugs <at> gmail.com>, "Eli Zaretskii" <eliz <at> gnu.org>
Cc: 72681-done <at> debbugs.gnu.org
Subject: Re: bug#72681: 31.0.50;
 visual-wrap-prefix-mode interacts badly with plain lists in org-mode
Date: Sun, 18 Aug 2024 19:53:36 +1000
[Message part 1 (text/plain, inline)]
Hi again Jim,

I haven't isolated this one yet, but I'm flagging in case it rings any bells for you -- I'm getting rendering-lockups with dart-mode when I enable visual-wrap-prefix-mode.  I've checked a couple of other programming modes which seem fine.  My money was on lsp-mode (and maybe lens display), but I've disabled lsp entirely and it still locks up.

I don't get a backtrace (with debug-on-error), but I can get this (when I hit C-n to see anything is happening, as the screen goes blank):
===
Debugger entered--Lisp error: (args-out-of-range 519 519)
  line-move-visual(1 nil)
  line-move(1 nil nil 1)
  next-line(1 1)
  funcall-interactively(next-line 1 1)
  command-execute(next-line)
===

I'll keep trying to isolate it.  So far my repo is "open .dart file, M-x visual-wrap-prefix-mode".

cheers, Mark

On Sun, Aug 18, 2024, at 11:40 AM, Jim Porter wrote:
> On 8/17/2024 5:02 PM, Mark Hepburn wrote:
> > Thanks Jim, nice work -- yes that seems to work perfectly again for all 
> > the problematic files I had before.
> 
> Great, thanks for checking. I've therefore merged this to the master 
> branch as 135da3556bb. Closing this bug now.
> 
> (Though of course if you find any other issues with the new 
> 'visual-wrap-prefix-mode' code, just let me know and I'll try to fix it.)
> 
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72681; Package emacs. (Sun, 18 Aug 2024 17:13:03 GMT) Full text and rfc822 format available.

Message #25 received at 72681 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Mark Hepburn <mark <at> markhepburn.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 72681 <at> debbugs.gnu.org
Subject: Re: bug#72681: 31.0.50; visual-wrap-prefix-mode interacts badly with
 plain lists in org-mode
Date: Sun, 18 Aug 2024 10:11:07 -0700
On 8/18/2024 2:53 AM, Mark Hepburn wrote:
> Hi again Jim,
> 
> I haven't isolated this one yet, but I'm flagging in case it rings any 
> bells for you -- I'm getting rendering-lockups with dart-mode when I 
> enable visual-wrap-prefix-mode.  I've checked a couple of other 
> programming modes which seem fine.  My money was on lsp-mode (and maybe 
> lens display), but I've disabled lsp entirely and it still locks up.

I've tried installing dart-mode and enabling visual-wrap-prefix-mode 
(and visual-line-mode) in a sample file, and wasn't able to reproduce 
any hangs. If you figure out how to reproduce this, just file a new bug 
and CC me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72681; Package emacs. (Sun, 25 Aug 2024 05:57:01 GMT) Full text and rfc822 format available.

Message #28 received at 72681 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Mark Hepburn" <mark <at> markhepburn.com>
Cc: jporterbugs <at> gmail.com, 72681 <at> debbugs.gnu.org
Subject: Re: bug#72681: 31.0.50;
 visual-wrap-prefix-mode interacts badly with plain lists in org-mode
Date: Sun, 25 Aug 2024 08:55:25 +0300
> Date: Sun, 25 Aug 2024 10:12:41 +1000
> From: "Mark Hepburn" <mark <at> markhepburn.com>
> Cc: "Eli Zaretskii" <eliz <at> gnu.org>
> 
> As an added bonus, the patch from bug#72721 fixes this one too.

This one was supposed to be fixed already, by a different change.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72681; Package emacs. (Sun, 25 Aug 2024 18:53:02 GMT) Full text and rfc822 format available.

Message #31 received at 72681 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Mark Hepburn <mark <at> markhepburn.com>
Cc: 72681 <at> debbugs.gnu.org
Subject: Re: bug#72681: 31.0.50; visual-wrap-prefix-mode interacts badly with
 plain lists in org-mode
Date: Sun, 25 Aug 2024 11:50:24 -0700
On 8/24/2024 10:55 PM, Eli Zaretskii wrote:
>> Date: Sun, 25 Aug 2024 10:12:41 +1000
>> From: "Mark Hepburn" <mark <at> markhepburn.com>
>> Cc: "Eli Zaretskii" <eliz <at> gnu.org>
>>
>> As an added bonus, the patch from bug#72721 fixes this one too.
> 
> This one was supposed to be fixed already, by a different change.

Mark, by "this one", did you mean the dart-mode issue you'd mentioned?

On 8/18/2024 2:53 AM, Mark Hepburn wrote:
> I'm getting rendering-lockups with dart-mode when I enable visual-wrap-prefix-mode.

If so, that's good news, and the lockup does indeed sound like bug#72721.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72681; Package emacs. (Sun, 25 Aug 2024 21:00:01 GMT) Full text and rfc822 format available.

Message #34 received at 72681 <at> debbugs.gnu.org (full text, mbox):

From: "Mark Hepburn" <mark <at> markhepburn.com>
To: "Jim Porter" <jporterbugs <at> gmail.com>, "Eli Zaretskii" <eliz <at> gnu.org>
Cc: 72681 <at> debbugs.gnu.org
Subject: Re: bug#72681: 31.0.50;
 visual-wrap-prefix-mode interacts badly with plain lists in org-mode
Date: Mon, 26 Aug 2024 06:58:00 +1000
[Message part 1 (text/plain, inline)]
Oops, sorry -- the lockup was resolved with bug#72721 (I had it down to a reproduction case using diff-hl, which adds fringe displays to highlight changed lines).

The "this one" involved lsp-dart, which adds guide-lines to show hierarchy.  I didn't have a minimal reproduction case yet, but it was using text-overlays to show the guidelines, which were mis-rendered when overlapping with the min-width etc properties added by visual-line-wrap-mode.  That was resolved with the same patch from bug#72721.

Apologies for the lack of context.

On Mon, Aug 26, 2024, at 4:50 AM, Jim Porter wrote:
> On 8/24/2024 10:55 PM, Eli Zaretskii wrote:
> >> Date: Sun, 25 Aug 2024 10:12:41 +1000
> >> From: "Mark Hepburn" <mark <at> markhepburn.com>
> >> Cc: "Eli Zaretskii" <eliz <at> gnu.org>
> >>
> >> As an added bonus, the patch from bug#72721 fixes this one too.
> > 
> > This one was supposed to be fixed already, by a different change.
> 
> Mark, by "this one", did you mean the dart-mode issue you'd mentioned?
> 
> On 8/18/2024 2:53 AM, Mark Hepburn wrote:
> > I'm getting rendering-lockups with dart-mode when I enable visual-wrap-prefix-mode.
> 
> If so, that's good news, and the lockup does indeed sound like bug#72721.
> 
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 23 Sep 2024 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 265 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.