How get a list of active minor modes in current buffer?

Docs (info "(elisp)Minor Mode Conventions") say:

 Define a variable whose name ends in ‘-mode’.  We call this the
 "mode variable".  The minor mode command should set this variable.
 The value will be ‘nil’ if the mode is disabled, and non-‘nil’ if
 the mode is enabled.  The variable should be buffer-local if the
 minor mode is buffer-local.

I ended with:

(dolist (m minor-mode-list)
  (when (symbol-value m)
    (push m modes)))

describe-mode sources have notes that:

;; Older packages do not register in minor-mode-list but only in
;; minor-mode-alist.

I don't know if that still valid point...

  • 2
    Doesn't describe-mode give you an adequate list of the active minor modes in the current buffer?
    – Drew
    Apr 20, 2015 at 1:28
  • 1
    @Drew It sounds like he maybe wants it programmatically?
    – nanny
    Apr 20, 2015 at 18:56
  • 1
    @nanny: Yes, I guessed that. In that cases, one place to start would be to look at the code for describe-mode - if that is otherwise adequate.
    – Drew
    Apr 20, 2015 at 20:32

3 Answers 3


I tested the (mapcar #'car minor-mode-alist) solution, but its length doesn't change after I disable a minor mode (while M-x describe-mode reflects this). Moreover, it seems inaccurate as I can't find some minor-modes listed by M-x describe-mode.

I tried the package manage-minor-mode which allows users to enable/disable a minor-mode through an interface. manager-minor-mode doesn't have the issues aforementioned and here is the function it uses to look up active minor-modes:

(defun manage-minor-mode--active-list ()
  "Get a list of which minor modes are enabled in the current buffer."
  (let ($list)
    (mapc (lambda ($mode)
            (condition-case nil
                (if (and (symbolp $mode) (symbol-value $mode))
                    (setq $list (cons $mode $list)))
              (error nil)))
    (sort $list 'string<)))
  • Yeah, minor-mode-list & minor-mode-alist are just global registries. In order to filter buffer local enabled minor modes I think we need to check symbol value NAME-mode is t. The code you provided does this within expression (and (symbolp $mode) (symbol-value $mode)) (though it checks for non-nil). Great idea, tnx!
    – gavenkoa
    Dec 22, 2020 at 21:57

If you're just looking to see what minor modes are being used in a buffer, but don't need to use the list programmatically use:

M-x describe-mode

This command will open a new buffer that begins with a full list of your minor modes, as well as giving a brief description of the major modes, and any parent modes that may have been run.

  • 2
    While this may not exactly answer the question of the OP, this was the first result I found when searching for this question. Since Drew's comment solved my use case, I thought it deserved a full answer for future searchers.
    – Wilduck
    Jun 1, 2016 at 15:08
  • +1 for demonstrating the more general purpose solution to the problem. describe-mode is especially useful!
    – ephsmith
    Sep 14, 2017 at 2:03

Try this:

(mapcar #'car minor-mode-alist)

In fact, you will find that this value often differs from minor-mode-list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.