[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: Sun, 24 Sep 2017 10:26:48 -0700 (PDT)

> > Has someone actually reported a problem that s?he ran into by
> > encountering an actual mode function that was not idempotent?
> I think I mentioned visual-line-mode; the fact that it's not
> idempotent is a concrete (though minor) problem for me.  I enable
> it in a hook, and a major mode that I use enables it too.  Due to
> the way visual-line-mode works, disabling it after this doesn't
> restore my original settings.

`visual-line-mode' is distributed with Emacs.  It sounds like
what you report about it is a bug.

Or is `visual-line-mode' intentionally doing what it does, to
have some state be different for different times it is turned
on?  If not - if its non-idempotence is just an unintentional
behavior (a mistake), then it is just a bug that needs to be fixed.

That Emacs chooses to have its distributed modes be idempotent
is one thing.  That some 3rd-party code might also mistakenly
(unintentionally) prove to be non-idempotent is another, but
similar thing.  Such cases represent things to fix.

That is different from establishing a convention that
modes should never, intentionally or unintentionally,
be non-idempotent.

reply via email to

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