help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List of major modes?


From: Kevin Rodgers
Subject: Re: List of major modes?
Date: Wed, 09 Nov 2005 12:03:51 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

David Reitter wrote:
> How would I go about compiling a list of all major modes available in
> the current emacs session?
> (Both loaded ones and autoloadable ones.)
>
> My first thought was doing something like
>
>  (apropos-internal ".*-mode$")
>
> which works, but doesn't distinguish between major and minor modes,
> which would be important.
>
> I cannot actually run any of the mode functions (would take way too long).
>
>  From looking at the elisp level code, there is very little
> programmatic distinction between minor and major modes, at least
> nothing that could be easily detected.

Here's the best I could come up with:

(apropos-internal "-mode\\'"
                  (lambda (mode)
                    (and (commandp mode)
                         (string-match "\\`Major mode\\>"
                                       (documentation mode)))))

--
Kevin Rodgers





reply via email to

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