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: Drew Adams
Subject: RE: Should mode commands be idempotent?
Date: Tue, 26 Sep 2017 11:50:13 -0700 (PDT)

> >> FWIW, I can't off the top of my head think of a reason why (foo-mode 1)
> >> followed by (foo-mode 1) should do something different than just calling
> >> it once.
> 
> > Just what do you have in mind, for the meaning here of
> > "do something different"?  Are we saying that the state
> > of the Emacs session after the second call should be
> > identical to the state after the first call?  Just what
> > kind of "identical" would be meant?
> 
> Yes, idempotence: calling it N times is the exact same as calling it once.

Good luck with such a guideline.  The state of an Emacs
session is _never_ exactly the same after each time you
turn on a mode - any mode, any session.  So many things
change...

If you don't want to specify what can and cannot change,
to be able to satisfy the guideline, then the guideline
is effectively useless.

This isn't Haskell.  (And even for Haskell the session
state changes.)



reply via email to

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