[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?
- Should mode commands be idempotent?, Philipp Stephani, 2017/09/19
- Re: Should mode commands be idempotent?, Clément Pit-Claudel, 2017/09/19
- Re: Should mode commands be idempotent?, Stefan Monnier, 2017/09/20
- Re: Should mode commands be idempotent?, Clément Pit-Claudel, 2017/09/23
- Re: Should mode commands be idempotent?, Stefan Monnier, 2017/09/23
- Re: Should mode commands be idempotent?, Stefan Monnier, 2017/09/23
RE: Should mode commands be idempotent?, Drew Adams, 2017/09/19