[Top][All Lists]
[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: |
Mon, 14 Nov 2005 09:26:03 -0700 |
User-agent: |
Mozilla Thunderbird 0.9 (X11/20041105) |
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.
For example:
* The major mode should usually have its own keymap, which is used
as the local keymap in all buffers in that mode. The major mode
command should call `use-local-map' to install this local map.
*Note Active Keymaps::, for more information.
This keymap should be stored permanently in a global variable named
`MODENAME-mode-map'. Normally the library that defines the mode
sets this variable.
So you could check (keymapp (intern-soft (concat mode "-map"))) in the
apropos-internal PREDICATE.
--
Kevin Rodgers
- Re: List of major modes?, Lennart Borgman, 2005/11/11
- Re: List of major modes?, David Reitter, 2005/11/11
- Re: List of major modes?, Lennart Borgman, 2005/11/11
- Re: List of major modes?,
Kevin Rodgers <=
- Re: List of major modes?, Richard M. Stallman, 2005/11/15
- Re: List of major modes?, Lennart Borgman, 2005/11/15
- Re: List of major modes?, Stefan Monnier, 2005/11/15
- Re: List of major modes?, Richard M. Stallman, 2005/11/15
- Re: List of major modes?, Alan Mackenzie, 2005/11/15
- Re: List of major modes?, Richard M. Stallman, 2005/11/15
- Re: List of major modes?, David Reitter, 2005/11/16
- Re: List of major modes?, Richard M. Stallman, 2005/11/17