emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q: Invisible text spec + define minor mode macro


From: Arthur Miller
Subject: Re: Q: Invisible text spec + define minor mode macro
Date: Wed, 21 Apr 2021 22:14:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt)

Tassilo Horn <tsdh@gnu.org> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>
> Hi Arthur,
>
>> After playing a bit more: if I scroll through entire file before I
>> enable my mode, then entire file is processed correctly.  But if file
>> is not scrolled through, then only 3½ screen pages are processed.  Has
>> nothing to do with regex I use, just with text being shown on screen
>> or not. I don't find anything in docs about that. A bug? Or
>> undocumented behaviour? Or something else I am missing here?
>
> I've tried it and can confirm your observations.  Your code is correct,
> though.  The funcion `hbm--update-line' is called 400 times at the right
> positions and puts the 'invisible text property there.
>
> Then I augmented that function to spit out the `buffer-substring' where
> it puts the property, and that showed that lines became invisible where
> the text was already fontified such as
>
>   #("#+end_src" 0 4 (fontified t font-lock-fontified t
>    font-lock-multiline t face org-block-end-line wrap-prefix #("#" 0 1
>    (face org-block-end-line font-lock-multiline t font-lock-fontified t
>    fontified t))) 4 9 (fontified t font-lock-fontified t
>    font-lock-multiline t face org-block-end-line wrap-prefix #("#" 0 1
>    (face org-block-end-line font-lock-multiline t font-lock-fontified t
>    fontified t))))
>
> and stopped working at the next line
>
>   #("#+begin_src emacs-lisp" 0 22 (fontified nil))
>
> which is not yet fontified.  And indeed, as soon as you disable
> `font-lock-mode' your minor mode starts working fine.  (With
> `font-lock-mode', you can "unhide" a line also by editing in it which
> will trigger refontification of that region.)
>
> The problem is in Org: it has tons of fontification functions such as
> `org-fontify-meta-lines-and-blocks' which calls
> `org-fontify-meta-lines-and-blocks-1' which removes `display',
> `invisible', and `intangible' text properties.
>
> So it seems you cannot use those properties in a sensible way in org
> files...
>
> Bye,
> Tassilo

Thank you very much for looking through it and clarifying what
happens. Eli also explained in the bug repport what is going on.

I will try with custom visibility spec instead and see if I can keep my
property that way :).

Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]