* Cannot set invisible text property
@ 2022-01-06 22:48 Enrico Flor
2022-01-07 22:26 ` John Kitchin
2022-01-12 14:05 ` Ihor Radchenko
0 siblings, 2 replies; 4+ messages in thread
From: Enrico Flor @ 2022-01-06 22:48 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 706 bytes --]
In a minor mode I wrote for myself, I use add-text-properties to make
certain things invisible. This does not work in org-mode, and I don't
understand why. For instance, the following has no effect in when the
buffer is in org-mode (and only when it's in org mode):
(add-text-properties 1 3 '(invisible t))
Any other text property I try to add does not give me any problem.
I have also tried to achieve the same by adding things to
buffer-invisibility-spec, but again, the following has no effect
whatsoever, if in org-mode:
(add-text-properties 1 3 '(invisible hide-this-stuff))
(add-to-invisibility-spec '(hide-this-stuff))
Can anyone give me a hint as to what is going on?
Thank you.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Cannot set invisible text property
2022-01-06 22:48 Cannot set invisible text property Enrico Flor
@ 2022-01-07 22:26 ` John Kitchin
2022-01-12 14:05 ` Ihor Radchenko
1 sibling, 0 replies; 4+ messages in thread
From: John Kitchin @ 2022-01-07 22:26 UTC (permalink / raw)
To: Enrico Flor; +Cc: org-mode-email
[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]
Maybe try this instead (you added the symbol as a list, not just a symbol):
123
#+BEGIN_SRC emacs-lisp
(add-text-properties 1 3 '(invisible hide-this-stuff))
(add-to-invisibility-spec 'hide-this-stuff)
#+END_SRC
#+RESULTS:
: (hide-this-stuff (org-hide-block . t) (org-link) (outline . t) t)
#+BEGIN_SRC emacs-lisp
(remove-from-invisibility-spec 'hide-this-stuff)
#+END_SRC
#+RESULTS:
: ((org-hide-block . t) (org-link) (outline . t) t)
John
-----------------------------------
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
On Thu, Jan 6, 2022 at 5:48 PM Enrico Flor <enrico@eflor.net> wrote:
> In a minor mode I wrote for myself, I use add-text-properties to make
> certain things invisible. This does not work in org-mode, and I don't
> understand why. For instance, the following has no effect in when the
> buffer is in org-mode (and only when it's in org mode):
>
> (add-text-properties 1 3 '(invisible t))
>
> Any other text property I try to add does not give me any problem.
> I have also tried to achieve the same by adding things to
> buffer-invisibility-spec, but again, the following has no effect
> whatsoever, if in org-mode:
>
> (add-text-properties 1 3 '(invisible hide-this-stuff))
> (add-to-invisibility-spec '(hide-this-stuff))
>
> Can anyone give me a hint as to what is going on?
>
> Thank you.
>
[-- Attachment #2: Type: text/html, Size: 2251 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Cannot set invisible text property
2022-01-06 22:48 Cannot set invisible text property Enrico Flor
2022-01-07 22:26 ` John Kitchin
@ 2022-01-12 14:05 ` Ihor Radchenko
2022-01-12 15:10 ` Enrico Flor
1 sibling, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2022-01-12 14:05 UTC (permalink / raw)
To: Enrico Flor; +Cc: emacs-orgmode
Enrico Flor <enrico@eflor.net> writes:
> In a minor mode I wrote for myself, I use add-text-properties to make
> certain things invisible. This does not work in org-mode, and I don't
> understand why. For instance, the following has no effect in when the
> buffer is in org-mode (and only when it's in org mode):
>
> (add-text-properties 1 3 '(invisible t))
This is because Org makes use of invisible text property during
fontification. You should either apply invisibility in Org through
font-lock, or do it temporarily until next re-fontification via
(with-silent-modifications (add-text-properties 1 3 '(invisible t)))
Best,
Ihor
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Cannot set invisible text property
2022-01-12 14:05 ` Ihor Radchenko
@ 2022-01-12 15:10 ` Enrico Flor
0 siblings, 0 replies; 4+ messages in thread
From: Enrico Flor @ 2022-01-12 15:10 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 453 bytes --]
Ihor Radchenko <yantar92@gmail.com> writes:
> This is because Org makes use of invisible text property during
> fontification. You should either apply invisibility in Org through
> font-lock, or do it temporarily until next re-fontification via
> (with-silent-modifications (add-text-properties 1 3 '(invisible t)))
Thank you so much! At some point I figured I had to actually study
font-lock and I did solve it, with font-lock-add-keywords.
Enrico
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-01-12 15:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-06 22:48 Cannot set invisible text property Enrico Flor
2022-01-07 22:26 ` John Kitchin
2022-01-12 14:05 ` Ihor Radchenko
2022-01-12 15:10 ` Enrico Flor
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).