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: Alan Mackenzie
Subject: Re: List of major modes?
Date: Tue, 15 Nov 2005 10:22:01 +0000 (GMT)


On Mon, 14 Nov 2005, Kevin Rodgers wrote:

>David Reitter wrote:
> > The following dynamic definition seems to "sort of" work.

> > (defun major-modes ()
> >  (apropos-internal "-mode\\'"
> >    (lambda (mode)
> >      (and (commandp mode)
> >       (not (string-match "\\`turn-\\(on\\|off\\)-"
> >                    (symbol-name mode)))
> >         (not (assq mode minor-mode-list))))))


> > I don't know, however, whether minor-mode-list is complete, i.e.
> > whether it contains the not-yet-auto-loaded minor modes. From what I
> > see in easy-mmode.el, it doesn't look like it.

>I still think it would be better to include functions that follow the
>major mode conventions than to exclude functions that don't follow the
>minor mode conventions.  The Emacs Lisp manual has nodes describing both
>sets of conventions.

It is impossible to create a list of major modes, because a major mode is
simply a lisp function, with nothing definitive to distinguish it from
any other lisp function.

So how about having a property `emacs-mode' on symbols, with valid values
(major minor major-minor nil)?  Getting a list of major modes would then
be trivial.  (OK, for Emacs 23. ;-)

>-- 
>Kevin Rodgers

-- 
Alan Mackenzie (Munich, Germany)






reply via email to

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