[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A programming puzzle with buffer-local hooks
From: |
Stefan Monnier |
Subject: |
Re: A programming puzzle with buffer-local hooks |
Date: |
Thu, 18 May 2017 12:51:01 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
> The usual trick is to make the hook buffer local.
Can't work because the focus events don't care about the current-buffer.
> 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.
Stefan