[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: How do I find out what minor modes are in effect?
From: |
Doug Lewan |
Subject: |
RE: How do I find out what minor modes are in effect? |
Date: |
Wed, 11 Apr 2012 14:28:11 +0000 |
>
> Doug Lewan <dougl@shubertticketing.com> writes:
>
> >
> > How do I find out what minor modes are in effect?
>
> Jambunathan K [kjambunathan@gmail.com] responded:
>
> This suggests that you can steal some code from the C-h k C-h m .
>
> M-x find-function RET describe-mode RET
>
A quick peek revealed this comment:
;; Document a minor mode if it is listed in minor-mode-alist,
;; non-nil, and has a function definition.
And about two minutes of reading and adapting got this code:
(let ((mode)
(result))
(dolist (mode minor-mode-list result)
(let ((fmode (or (get mode :minor-mode-function) mode)))
(if (and (boundp mode) (symbol-value mode) (fboundp fmode))
(push mode result))))
result)
I guess you should trust code more than documentation, said the embarassed
programmer.
Thanks.
,Doug