all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: A programming puzzle with buffer-local hooks
Date: Thu, 18 May 2017 14:38:09 -0400	[thread overview]
Message-ID: <dae6cebc-e5ed-9f9e-0e39-019ab29baf4c@gmail.com> (raw)
In-Reply-To: <jwvlgpuhzz6.fsf-monnier+gmane.emacs.devel@gnu.org>

On 2017-05-18 12:51, Stefan Monnier wrote:
>> I can think of two other tricks: reference counting (every time the
>> mode is disabled, check whether it's enabled anywhere else), and never
>> removing the hook.
> 
> Before removing the hook, check if there's still a buffer where the mode
> is activated.

That's what the line you quoted meant to say. Sorry if it wasn't clear :/

Clément.



  reply	other threads:[~2017-05-18 18:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 15:10 A programming puzzle with buffer-local hooks Clément Pit-Claudel
2017-05-18 15:16 ` Phillip Lord
2017-05-18 15:45   ` Clément Pit-Claudel
2017-05-18 16:51 ` Stefan Monnier
2017-05-18 18:38   ` Clément Pit-Claudel [this message]
2017-05-19  6:30 ` martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2017-05-18 15:54 Phillip Lord
2017-05-18 15:56 ` Clément Pit-Claudel
2017-05-18 18:46   ` Phillip Lord
2017-05-18 19:03     ` Clément Pit-Claudel

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=dae6cebc-e5ed-9f9e-0e39-019ab29baf4c@gmail.com \
    --to=cpitclaudel@gmail.com \
    --cc=emacs-devel@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.