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: David Reitter
Subject: Re: List of major modes?
Date: Fri, 11 Nov 2005 21:51:03 +0000

On 11 Nov 2005, at 19:12, Lennart Borgman wrote:

Drew Adams wrote:

Recent Emacs versions have `minor-mode-list' (not alist), a list of all
minor mode functions. There is no guarantee that it will be complete,
however. It is fed by `add-minor-mode'.

Would it not be best to make something similar for major modes? There are some requirements for what major modes should do and why not add a new requirement? It will not be very difficult to add it and many users would surely like it.

Changing the conventions for major modes wouldn't work that well, since that would basically create an incompatibility.

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.



reply via email to

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