From 7dde432d4c75d8f76220182c2daa639e13d69297 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 9 Apr 2003 01:36:28 +0000 Subject: [PATCH] (minor-mode-list): New variable. (add-minor-mode): Add to it. --- lisp/subr.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/subr.el b/lisp/subr.el index 17a7af41d4d..f5a629de924 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2094,6 +2094,14 @@ If SUFFIX is non-nil, add that at the end of the file name." (set-default-file-modes umask)))) +;; If a minor mode is not defined with define-minor-mode, +;; add it here explicitly. +;; isearch-mode is deliberately excluded, since you should +;; not call it yourself. +(defvar minor-mode-list '(auto-save-mode auto-fill-mode abbrev-mode + overwrite-mode view-mode) + "List of all minor mode functions.") + (defun add-minor-mode (toggle name &optional keymap after toggle-fun) "Register a new minor mode. @@ -2118,6 +2126,9 @@ It defaults to (and should by convention be) TOGGLE. If TOGGLE has a non-nil `:included' property, an entry for the mode is included in the mode-line minor mode menu. If TOGGLE has a `:menu-tag', that is used for the menu item's label." + (unless (memq toggle minor-mode-list) + (push toggle minor-mode-list)) + (unless toggle-fun (setq toggle-fun toggle)) ;; Add the name to the minor-mode-alist. (when name -- 2.11.4.GIT