unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* List of major modes?
@ 2005-11-09  9:40 David Reitter
  2005-11-09 18:02 ` Edward O'Connor
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: David Reitter @ 2005-11-09  9:40 UTC (permalink / raw)


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.

thanks...

^ permalink raw reply	[flat|nested] 20+ messages in thread
[parent not found: <mailman.14537.1131532545.20277.help-gnu-emacs@gnu.org>]
* Re: List of major modes?
@ 2005-11-11 17:56 David Reitter
  2005-11-11 18:35 ` Henrik Enberg
  0 siblings, 1 reply; 20+ messages in thread
From: David Reitter @ 2005-11-11 17:56 UTC (permalink / raw)
  Cc: Edward O'Connor

>        (not (assq symbol minor-mode-alist))))

Good idea, but unfortunately minor-mode-alist contains stuff to be  
shown in the mode-line, so we're not excluding minor modes that don't  
display anything in the mode line (mouse-wheel-mode for example).

Searching the documentation string (Kevin's idea) won't be reliable,  
obviously.

Looking for (kill-all-local-variables) in the definition would be  
another possibility, but who guarantees that this will occur in the  
mode function definition directly, and not in some function called  
from there.

The only solution I can see is to patch define-minor-mode - as a last  
resort.

- D

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2005-11-15 23:22 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-09  9:40 List of major modes? David Reitter
2005-11-09 18:02 ` Edward O'Connor
2005-11-09 19:03 ` Kevin Rodgers
     [not found] ` <mailman.14613.1131563363.20277.help-gnu-emacs@gnu.org>
2005-11-10  1:04   ` rgb
2005-11-10  1:15     ` Lennart Borgman
     [not found]     ` <mailman.14670.1131585340.20277.help-gnu-emacs@gnu.org>
2005-11-10  1:34       ` rgb
     [not found] <mailman.14537.1131532545.20277.help-gnu-emacs@gnu.org>
2005-11-09 17:05 ` rgb
  -- strict thread matches above, loose matches on Subject: below --
2005-11-11 17:56 David Reitter
2005-11-11 18:35 ` Henrik Enberg
2005-11-11 18:51   ` Drew Adams
2005-11-11 19:12     ` Lennart Borgman
2005-11-11 21:51       ` David Reitter
2005-11-11 22:18         ` Lennart Borgman
2005-11-14 16:26         ` Kevin Rodgers
2005-11-14 16:40           ` Lennart Borgman
2005-11-14 19:32             ` Stefan Monnier
2005-11-15  5:43           ` Richard M. Stallman
2005-11-15 10:22           ` Alan Mackenzie
2005-11-15 18:21             ` Kevin Rodgers
2005-11-15 23:22             ` Richard M. Stallman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).