all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: sokobania.01@gmail.com
To: help-gnu-emacs@gnu.org
Subject: Re: How to save invisible (lisp) data in a text file
Date: Mon, 1 Sep 2014 01:31:45 -0700 (PDT)	[thread overview]
Message-ID: <8f2b566e-a25f-47fb-bc29-055e75cd35d4@googlegroups.com> (raw)
In-Reply-To: <mailman.7874.1409342719.1147.help-gnu-emacs@gnu.org>

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
`facemenu-remove-special'."
  (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?


  parent reply	other threads:[~2014-09-01  8:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 14:04 How to save invisible (lisp) data in a text file sokobania
2014-08-21 18:28 ` Stefan Monnier
2014-08-22  6:13 ` Thien-Thi Nguyen
2014-08-23 12:34 ` lee
2014-08-29  9:26 ` sokobania.01
2014-08-29 20:03   ` Stefan Monnier
     [not found]   ` <mailman.7874.1409342719.1147.help-gnu-emacs@gnu.org>
2014-09-01  8:31     ` sokobania.01 [this message]
2014-09-02  1:56       ` Stefan Monnier
     [not found] <mailman.185.1408636859.24723.help-gnu-emacs@gnu.org>
2014-08-21 16:38 ` Buchs, Kevin J.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f2b566e-a25f-47fb-bc29-055e75cd35d4@googlegroups.com \
    --to=sokobania.01@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.