[Top][All Lists]

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

Re: How to save invisible (lisp) data in a text file

From: sokobania . 01
Subject: Re: How to save invisible (lisp) data in a text file
Date: Mon, 1 Sep 2014 01:31:45 -0700 (PDT)
User-agent: G2/1.0

Le vendredi 29 août 2014 22:03:14 UTC+2, Stefan Monnier a écrit :
> > I will just hide them using facemenu-set-invisible.
> Please don't use facemenu-set-invisible.  Instead add the `invisible'
> property with `put-text-property' (which is basically what
> facemenu-set-invisible does internally).
> No: facemenu-set-invisible is a very little used thing,
> that's basically useless in 99.99% of the cases.

Hmmm. I think I need an explanation!

In my GNU Emacs 24.3.1, facemenu-set-invisible is defined as:

(defun facemenu-set-invisible (start end)
  "Make the region invisible.
This sets the `invisible' text property; it can be undone with
  (interactive "r")
  (add-text-properties start end '(invisible t)))

Imho, it seems:
- It does exactly what I need (make the region invisible).
- Its implementation is exactly the code you recommend.
- Even if it's only 1 line of code, it's (a little bit) 
  higher level than this mere line of code.
- It has the same implementation within Xemacs.

I imagine there is probably very little chance 
that this implementation changes.

Without your warning, I would have preferred to use a high
level function that makes the region invisible rather than 
having to deal with the internal aspects of doing that 
(I mean "rather than adding text properties").

So, can you explain why you don't recommend to use it?
Is it that anyone who wants to make the region invisible
should know that it must be done with text properties?

reply via email to

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