>>>>> Drew Adams <drew.adams@oracle.com> writes:
> Good luck with such a guideline. The state of an Emacs session is _nev=
er_
> exactly the same after each time you turn on a mode - any mode, any se=
ssion.
> So many things change...
I think we can reduce the scope of what we're saying:
The statement I made only applies if the command is called in immediate
succession. That is, the function is *itself* idempotent; it doesn't gu=
arantee
that intervening effects are somehow negated.
That is, the following should be functionally equivalent:
=C2=A0 =C2=A0 (foo-mode 1)
=C2=A0 =C2=A0 (progn (foo-mode 1) (foo-mode 1))
I don't see what great difficulty this poses. If a mode author is doing=
thing
inside `foo-mode' like changing the system or the disk, that's exac=
tly the
sort of thing our guideline seeks to prevent.
Given that all current and past maintainers seem to agree, how about=
the following patch for the Lisp manual?=C2=A0
--94eb2c13f0a0e4e5ff055b0aba1e--
--94eb2c13f0a0e4e603055b0aba20
Content-Type: text/plain; charset="US-ASCII";
name="0001-Document-that-mode-commands-should-be-idempotent.txt"
Content-Disposition: attachment;
filename="0001-Document-that-mode-commands-should-be-idempotent.txt"
Content-Transfer-Encoding: base64
Content-ID: <15efc9a2266818745061>
X-Attachment-Id: 15efc9a2266818745061
RnJvbSA0NjZlZTU4NTNhMDdmOTA1OTMxNDllNGRlMDdmOTI4NDVlMDc2MTcwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwIFN0ZXBoYW5pIDxwaHN0QGdvb2dsZS5jb20+CkRh
dGU6IFN1biwgOCBPY3QgMjAxNyAxNzoyNTozMSArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIERvY3Vt
ZW50IHRoYXQgbW9kZSBjb21tYW5kcyBzaG91bGQgYmUgaWRlbXBvdGVudC4KCiogZG9jL2xpc3By
ZWYvbW9kZXMudGV4aSAoTWFqb3IgTW9kZSBDb252ZW50aW9ucywgTWlub3IgTW9kZQpDb252ZW50
aW9ucyk6IERvY3VtZW50IHRoYXQgdGhlIG1vZGUgY29tbWFuZHMgc2hvdWxkIGJlIGlkZW1wb3Rl
bnQuCi0tLQogZG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