# HG changeset patch # User Richard M. Stallman # Date 1049852188 0 # Node ID 6cc9a6c84a9497a019f38edb166dc86d264bc43f # Parent b4cb33eddbaaef59c6608d18ee3be1c75121c82d (minor-mode-list): New variable. (add-minor-mode): Add to it. diff -r b4cb33eddbaa -r 6cc9a6c84a94 lisp/subr.el --- a/lisp/subr.el Wed Apr 09 01:34:38 2003 +0000 +++ b/lisp/subr.el Wed Apr 09 01:36:28 2003 +0000 @@ -2094,6 +2094,14 @@ (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 @@ 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