emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 798f07f: Document that mode commands should be id


From: Philipp Stephani
Subject: [Emacs-diffs] emacs-26 798f07f: Document that mode commands should be idempotent.
Date: Thu, 21 Dec 2017 15:49:19 -0500 (EST)

branch: emacs-26
commit 798f07f1509ac973a379db921bd796e0df7f2982
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    Document that mode commands should be idempotent.
    
    * doc/lispref/modes.texi (Major Mode Conventions, Minor Mode
    Conventions): Document that the mode commands should be idempotent.
---
 doc/lispref/modes.texi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index bd94aea..1a601ba 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -314,6 +314,11 @@ Data}, for other possible forms).  The name of the mode 
appears
 in the mode line.
 
 @item
+Calling the major mode command twice in direct succession should not
+fail and should do the same thing as calling the command only once.
+In other words, the major mode command should be idempotent.
+
address@hidden
 @cindex functions in modes
 Since all global names are in the same name space, all the global
 variables, constants, and functions that are part of the mode should
@@ -1412,6 +1417,10 @@ a minor mode in a mode hook is a little uglier:
 @noindent
 However, this is not very commonly done.
 
+  Enabling or disabling a minor mode twice in direct succession should
+not fail and should do the same thing as enabling or disabling it only
+once.  In other words, the minor mode command should be idempotent.
+
 @item
 Add an element to @code{minor-mode-alist} for each minor mode
 (@pxref{Definition of minor-mode-alist}), if you want to indicate the



reply via email to

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