[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Q] How to make text invisible without modifying the buffer?
From: |
Emanuel Berg |
Subject: |
Re: [Q] How to make text invisible without modifying the buffer? |
Date: |
Sat, 14 Aug 2021 02:01:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Rodrigo Morales wrote:
> To begin writing this mode, I was wondering: How to make
> a line invisible? and came up with the following expression
> which accomplishes that
>
> #+BEGIN_SRC elisp (put-text-property (point-at-bol) (+
> (point-at-eol) 1) 'invisible t) #+END_SRC
>
> The problem with this expression is the fact that it
> modifies the current buffer and I don't want this to happen
`narrow-to-region'?
Restrict editing in this buffer to the current region.
The rest of the text becomes temporarily invisible and
untouchable but is not deleted; if you save the buffer in
a file, the invisible text is included in the file. C-x
n w makes all visible again.
Flirting with not disaster perhaps but ...
--
underground experts united
https://dataswamp.org/~incal