[Top][All Lists]

[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: Jambunathan K
Subject: Re: How do I find out what minor modes are in effect?
Date: Wed, 11 Apr 2012 19:28:54 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (windows-nt)

Doug Lewan <address@hidden> writes:

> I'm writing a function that needs to change the major mode to do its stuff 
> properly.
> That can turn off minor modes too.
> The obvious polite thing to do is turn them all back on when I'm done.
> Resetting the major mode is easy:
> (defun vertical-text (text)
>   (let ((mode-to-restore major-mode)
>     (picture-mode)
>     ...
>     (funcall mode-to-restore)))
> How do I find out what minor modes are in effect?
> And in what order they were invoked?
> (They can stomp on each other and 
> I'd rather not introduce bugs 
> that are different from what the user already expects.
> (Ultimately, I think this might be generally useful,
> so a function like (save-mode) might emerge.)

When in "message-mode" (the buffer I am composing this message in) and I
do C-h m I see the following at the top of the resulting "Help" buffer.

,---- C-h m
| Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption
| Auto-Fill Column-Number File-Name-Shadow Font-Lock Footnote
| Global-Font-Lock Gnus-Message-Citation Ido-Everywhere Iswitchb
| Line-Number Mml Mouse-Wheel Shell-Dirtrack Tooltip Transient-Mark
| Which-Function

This suggests that you can steal some code from the C-h k C-h m .

M-x find-function RET describe-mode RET

> ,Douglas
> Douglas Lewan
> Shubert Ticketing
> (201) 489-8600 ext 224


reply via email to

[Prev in Thread] Current Thread [Next in Thread]