Skip to content

Commit

Permalink
Document how to make an autoloaded mode known
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed Mar 13, 2023
1 parent 199b602 commit ebf276b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
16 changes: 13 additions & 3 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
* A minor-mode menu for the mode line

This package implements a nested menu that gives access to all minor
modes. It can be used to toggle local and global minor modes, to
access mode-specific menus, and to display information about modes.
This package implements a nested menu that gives access to all known
minor modes (i.e., those listed in ~minor-mode-list~). It can be used
to toggle local and global minor modes, to access mode-specific menus,
and to display information about modes.

This menu is intended as a replacement for the incomplete, yet quite
space consuming, list of enabled minor modes that is displayed in the
Expand All @@ -14,6 +15,15 @@ Alternatively the menu can be bound globally, for example:
(global-set-key [S-down-mouse-3] 'minions-minor-modes-menu)
#+end_src

To list a mode even though the defining library has not been loaded
yet, you must add it to ~minor-mode-list~ yourself. Additionally it
must be autoloaded. For example:

#+begin_src emacs-lisp
(when (autoloadp (symbol-function 'glasses-mode))
(cl-pushnew 'glasses-mode minor-mode-list))
#+end_src

[[http://readme.emacsair.me/minions.png]]

Compatibility information can be found [[https://github.com/tarsius/minions/wiki][here]].
Expand Down
15 changes: 12 additions & 3 deletions minions.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,26 @@

;;; Commentary:

;; This package implements a nested menu that gives access to all minor
;; modes. It can be used to toggle local and global minor modes, to
;; access mode-specific menus, and to display information about modes.
;; This package implements a nested menu that gives access to all known
;; minor modes (i.e., those listed in `minor-mode-list'). It can be used
;; to toggle local and global minor modes, to access mode-specific menus,
;; and to display information about modes.

;; This menu is intended as a replacement for the incomplete, yet quite
;; space consuming, list of enabled minor modes that is displayed in the
;; mode line by default. To use the menu like this, enable Minions mode.

;; Alternatively the menu can be bound globally, for example:
;;
;; (global-set-key [S-down-mouse-3] 'minions-minor-modes-menu)

;; To list a mode even though the defining library has not been loaded
;; yet, you must add it to `minor-mode-list' yourself. Additionally it
;; must be autoloaded. For example:
;;
;; (when (autoloadp (symbol-function 'glasses-mode))
;; (cl-pushnew 'glasses-mode minor-mode-list))

;;; Code:

(require 'cl-lib)
Expand Down

0 comments on commit ebf276b

Please sign in to comment.