emacs-devel
[Top][All Lists]
Advanced

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

Re: Should mode commands be idempotent?


From: Clément Pit-Claudel
Subject: Re: Should mode commands be idempotent?
Date: Wed, 20 Sep 2017 09:24:11 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 2017-09-20 00:29, Stefan Monnier wrote:
>> Is there a way inside of a minor mode to check if it was already
>> enabled before the current call, short of having a second variable
>> for that?
>
> It shouldn't be needed: the idempotence should emerge naturally from the
> way the code is written, rather than being the result of special tests
> to detect that particular situation.

I'm not too sure: take the example of visual-line-mode: how do you make that 
idempotent without explicitly checking whether the mode has already been 
activated?



reply via email to

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