minad / org-modern

:unicorn: Modern Org Style
GNU General Public License v3.0
1.54k stars 48 forks source link

Errors with Emacs 30.1's visual-wrap-prefix-mode #237

Closed krisbalintona closed 1 week ago

krisbalintona commented 1 week ago

Hi,

My version of Emacs is:

GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2) of 2024-10-20

Recently, visual-wrap-prefix-mode (the successor to adaptive-wrap on GNU-Elpa, as far as I can tell), was added to Emacs 30.1. It's meant to prefix lines visually; that is, visually wrapped lines are left-aligned with the beginning of the text it continues.

At least from my testing, when using org-modern with visual-wrap-prefix-mode enabled, errors like the following appear when I call e.g. consult-line (with toggle-debug-on-error enabled):

Debugger entered--Lisp error: (wrong-type-argument listp #("▶" 0 1 (face org-modern-symbol)))
  add-display-text-property(0 2 min-width nil #("* " 0 1 (keymap (keymap (C-down-mouse-1 . org-mouse-move-tree-start) (C-drag-mouse-1 . org-mouse-move-tree) (follow-link . mouse-face) (mouse-3) (mouse-2 . org-open-at-mouse)) mouse-face highlight display #("▶" 0 1 (face org-modern-symbol)) face org-level-1 fontified t) 1 2 (keymap (keymap (C-down-mouse-1 . org-mouse-move-tree-start) (C-drag-mouse-1 . org-mouse-move-tree) (follow-link . mouse-face) (mouse-3) (mouse-2 . org-open-at-mouse)) mouse-face highlight face org-level-1 fontified t)))
  visual-wrap--content-prefix(#("* " 0 1 (keymap (keymap (C-down-mouse-1 . org-mouse-move-tree-start) (C-drag-mouse-1 . org-mouse-move-tree) (follow-link . mouse-face) (mouse-3) (mouse-2 . org-open-at-mouse)) mouse-face highlight display #("▶" 0 1 (face org-modern-symbol)) face org-level-1 fontified t) 1 2 (keymap (keymap (C-down-mouse-1 . org-mouse-move-tree-start) (C-drag-mouse-1 . org-mouse-move-tree) (follow-link . mouse-face) (mouse-3) (mouse-2 . org-open-at-mouse)) mouse-face highlight face org-level-1 fontified t)) 144)
  visual-wrap--apply-to-line(144)
  visual-wrap-prefix-function(1 32963)
  #f(compiled-function (fun) #<bytecode 0x1baa355fbb1815bf>)(visual-wrap-prefix-function)
  jit-lock--run-functions(1 32963)
  jit-lock-fontify-now()
  consult--fontify-all()
  consult--line-candidates(nil 882)
  #f(compiled-function () #<bytecode -0xca8f0d9a3e20413>)()
  consult-line(nil nil)
  funcall-interactively(consult-line nil nil)
  command-execute(consult-line)

Not sure whether org-modern's implementation, consult, visual-wrap-prefix-mode is at fault, but I thought I'd create an issue here first since I haven't run across any malfunctions with visual-wrap-prefix-mode beside this one.