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: Philipp Stephani
Subject: Re: Should mode commands be idempotent?
Date: Sun, 08 Oct 2017 15:09:27 +0000



John Wiegley <address@hidden> schrieb am Mi., 20. Sep. 2017 um 17:38 Uhr:
>>>>> "CP" == Clément Pit-Claudel <address@hidden> writes:

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

Also, is there a motivation for introducing this new requirement, seeing as
how we've never had such a restriction in the past?

Some cases I've come across (for lsp-mode, which is currently not idempotent):
- Enabling a minor mode in both a parent and a derived mode hook.
- Restoring buffers from the desktop file.
In such cases minor modes are activated twice, causing errors if they are not idempotent. 

reply via email to

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