[Top][All Lists]

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

RE: Should mode commands be idempotent?

From: Drew Adams
Subject: RE: Should mode commands be idempotent?
Date: Fri, 22 Sep 2017 08:54:23 -0700 (PDT)

> Users expect major modes to be idempotent.  Any time one is not, it
> will cause them surprises.  We should treat that as a bug and fix it
> to be idempotent.

Yes.  You're talking about code distributed with Emacs, no doubt.

And any 3rd-party library (if there were any) that might have
such a mode function would be well advised to make clear to its
users that the function is not idempotent, and explain why:
what to expect and why.

> As for minor modes, it has been pointed out (by Stefan?) that multiple
> hooks could enable the same major mode, and the result should be the
> same as if just one hook did so.

My question for this thread is this:

Is this proposal (add an explicit rule or convention stating
that mode functions should be idempotent) a solution looking
for a problem?

Has someone actually reported a problem that s?he ran into by
encountering an actual mode function that was not idempotent?

reply via email to

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