all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Is there a save-outline-visibility excursion or so?
Date: Thu, 23 May 2013 09:09:13 -0400	[thread overview]
Message-ID: <jwvwqqpj1ct.fsf-monnier+gmane.emacs.help@gnu.org> (raw)
In-Reply-To: 87k3mqrn6r.fsf@gmail.com

> A hidden-line-cookie is only written, if the headline is folded, and
> deleted if it is expanded. This is done by
> 'org-hlc-write-hidden-lines-cookies'. Thus to delete all cookies, I
> temporarily expand all subtrees, call the function, and then go back to
> the former visibility state and point position.

It would seem like it would be a lot simpler to write a loop that simply
erases your "cookies" without paying attention to the visibility state.

"do and then undo" is always a high-risk way to do nothing, so if you
can really do nothing instead, it's always a major reliability gain.
Your use of an indirect buffer luckily saves you from having to "do and
undo".  But indirect buffers suck.

BTW, rather than "insert" your cookies in the text (which has lots of
undesirable side effects, such as being visible in the saved file), why
not use overlays (in which case org-hlc-hide-hidden-lines-cookies would
just be a single call to remove-overlays).


        Stefan




  reply	other threads:[~2013-05-23 13:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  9:13 Is there a save-outline-visibility excursion or so? Thorsten Jolitz
2013-05-22  9:18 ` Jambunathan K
2013-05-22 10:12   ` Thorsten Jolitz
2013-05-22 10:25   ` Thorsten Jolitz
2013-05-22 12:39     ` Jambunathan K
2013-05-22 13:41       ` Thorsten Jolitz
2013-05-23  1:05 ` Stefan Monnier
2013-05-23 10:43   ` Thorsten Jolitz
2013-05-23 13:09     ` Stefan Monnier [this message]
2013-05-24 14:06       ` Thorsten Jolitz

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=jwvwqqpj1ct.fsf-monnier+gmane.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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.