emacs-devel
[Top][All Lists]
Advanced

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

Re: A programming puzzle with buffer-local hooks


From: Phillip Lord
Subject: Re: A programming puzzle with buffer-local hooks
Date: Thu, 18 May 2017 18:46:34 -0000
User-agent: SquirrelMail/1.5.2 [SVN]

On Thu, May 18, 2017 3:56 pm, Clément Pit-Claudel wrote:
> On 2017-05-18 11:54, Phillip Lord wrote:
>
>> On Thu, May 18, 2017 3:45 pm, Clément Pit-Claudel wrote:
>>
>>> On 2017-05-18 11:16, Phillip Lord wrote:
>>>
>>>
>>>> Add the hook globally, and then have your hook functions check
>>>> whether the mode is on or off before they do anything.
>>>
>>> I think that's mostly what I meant by "never removing the hook". Am I
>>>  misunderstanding you?
>>
>> Well, combined with making it global, yes.
>>
>>
>> I always found developing a minor mode where we add and remove hooks to
>> be a bit of a pain, because you can easily end up with different buffers
>> have different state during development. On the other hand, if you have
>> a single global hook, it's either there or not, just whether it works or
>> not is dependent only on whether the minor-mode is on or not.
>>
>> Seems a lot nicer to me.
>>
>
> I entirely agree.  But as a user I dislike these zombie hooks :)


Why? Perhaps the solution is to work out what you dislike about it, and
the see if we can do something generic to solve the problem. The issue is
not at all specific to your mode.

Phil




reply via email to

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