protesilaos / logos

A simple "focus mode" which can be applied to any buffer for reading, writing, or even doing a presentation.
https://protesilaos.com/emacs/logos
GNU General Public License v3.0
31 stars 0 forks source link

Freezing in org headlines with svg-tag-mode #15

Closed pseudomyne closed 3 months ago

pseudomyne commented 3 months ago

Hi Prot', Thank you for your wonderful work :cupid: When I logos-narrow-dwim using svg-tag-mode with svg-tags in org-mode headlines, I get a freezing error (from the debugger) :

Debugger entered--Lisp error: (args-out-of-range 11821)
  next-single-char-property-change(11821 cursor-sensor-functions nil 12070)
  #f(compiled-function (start end f) "Non-nil if F is missing somewhere between START and END." #<bytecode -0x1d517e45f5092da2>)(11821 12070 svg-tag--cursor-function)
  cursor-sensor--detect(#<window 3 on EMACS.org>)
  run-hook-with-args(cursor-sensor--detect #<window 3 on EMACS.org>)
  redisplay--pre-redisplay-functions(nil)
  redisplay_internal\ \(C\ function\)()

Any idea how to workaround this ?

protesilaos commented 3 months ago

From: xavier @.***> Date: Sun, 21 Jul 2024 12:21:34 -0700

Hi Prot', Thank you for your wonderful work :cupid:

You are welcome!

When I logos-narrow-dwim using svg-tag-mode with svg-tags in org-mode headlines, I get a freezing error (from the debugger) :

[... 10 lines elided]

Any idea how to workaround this ?

I will need to reproduce it locally. Can you provide me with a minimal setup that exhibits the problem?

-- Protesilaos Stavrou https://protesilaos.com

pseudomyne commented 3 months ago

I guess you mean emacs -Q... Alas, I'm totally lost in vanilla. I've even failed to make svg-tag-mode work. Here's how I failed to do so, for the (olympic) record :

Emacs -Q And in the scratch buffer :

(load "/home/xa/.emacs.d/elpa/logos-1.1.1/logos")
(load "/home/xa/.emacs.d/elpa/svg-tag-mode-20240624.857/svg-tag-mode")
(load "/home/xa/.emacs.d/elpa/svg-lib-0.3/svg-lib")

Those granted me a :tea: (meaning a t)

(setq svg-tag-tags
'((":TODO:" . ((lambda (tag) (svg-tag-make "TODO"))))))

(require 'svg-tag-mode)

;; from the package's author :
(setq svg-tag-tags
      '((":TODO:" . ((svg-tag-make "TODO" :face 'org-tag
      :radius 0 :inverse t :margin 5)))
        (":NOTE:" . ((svg-tag-make "NOTE" :face 'font-lock-comment-face
                                   :inverse nil :margin 0 :radius 0)))
        ("\([0-9a-zA-Z]\)" . ((lambda (tag)
                                (svg-tag-make tag :beg 1 :end -1 :radius 12))))
        ("\([0-9a-zA-Z][0-9a-zA-Z]\)" . ((lambda (tag)
                                           (svg-tag-make tag :beg 1 :end -1 :radius 8))))
        ("|[0-9a-zA-Z- ]+?|" . ((lambda (tag)
                                  (svg-tag-make tag :face 'font-lock-comment-face
                                                :margin 0 :beg 1 :end -1))))))
(svg-tag-mode t)

* blah :TODO: 
bmahm amgfjsdf ma kjak
** :TODO: bis
blah

Then M-x org-mode did display folded headlines, but no tag. I'm sorry..... I can't reproduce in a vanilla world.

pseudomyne commented 3 months ago

As a so-to-speak workaround, I disabled svg-tag-modein my focus / logos-narrow-dwim mode. I don't have the issue anymore so far.