From 466ee5853a07f90593149e4de07f92845e076170 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sun, 8 Oct 2017 17:25:31 +0200 Subject: [PATCH] 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index f7013da943..f2fc742495 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -313,6 +313,10 @@ Major Mode Conventions 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. + @item @cindex functions in modes Since all global names are in the same name space, all the global @@ -1412,6 +1416,10 @@ Minor Mode Conventions @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. + @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 -- 2.14.2