From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help,gmane.emacs.devel Subject: Re: List of major modes? Date: Tue, 15 Nov 2005 10:22:01 +0000 (GMT) Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1132056302 7744 80.91.229.2 (15 Nov 2005 12:05:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 15 Nov 2005 12:05:02 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, emacs-devel@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 15 13:04:54 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EbzWn-0001yD-Gn for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Nov 2005 13:03:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EbzWm-0000Mr-AC for geh-help-gnu-emacs@m.gmane.org; Tue, 15 Nov 2005 07:03:08 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EbySw-0001xe-Pq for help-gnu-emacs@gnu.org; Tue, 15 Nov 2005 05:55:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EbyRO-0001Sq-HK for help-gnu-emacs@gnu.org; Tue, 15 Nov 2005 05:53:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eby4R-0008Mn-Lz; Tue, 15 Nov 2005 05:29:52 -0500 Original-Received: from [193.149.49.134] (helo=acm.acm) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Eby4Q-00017I-Jk; Tue, 15 Nov 2005 05:29:47 -0500 Original-Received: from localhost (root@localhost) by acm.acm (8.8.8/8.8.8) with SMTP id KAA00276; Tue, 15 Nov 2005 10:22:03 GMT X-Sender: root@acm.acm Original-To: Kevin Rodgers In-Reply-To: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:31061 gmane.emacs.devel:46013 Archived-At: 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)