From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel,gmane.emacs.help Subject: Re: List of major modes? Date: Mon, 14 Nov 2005 09:26:03 -0700 Message-ID: References: <4374ED02.20904@student.lu.se> <976C42B7-60B9-4A3A-8BC7-7FB81E2F5FE1@gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1131986215 29000 80.91.229.2 (14 Nov 2005 16:36:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Nov 2005 16:36:55 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 14 17:36:54 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EbhGf-000287-An for ged-emacs-devel@m.gmane.org; Mon, 14 Nov 2005 17:33:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EbhGd-0002aA-J0 for ged-emacs-devel@m.gmane.org; Mon, 14 Nov 2005 11:33:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EbhGI-0002Yg-SP for emacs-devel@gnu.org; Mon, 14 Nov 2005 11:32:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EbhGH-0002YK-RR for emacs-devel@gnu.org; Mon, 14 Nov 2005 11:32:54 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EbhGH-0002YD-Gv for emacs-devel@gnu.org; Mon, 14 Nov 2005 11:32:53 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EbhGH-0008JH-HM for emacs-devel@gnu.org; Mon, 14 Nov 2005 11:32:53 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EbhDC-0000iM-5Z for emacs-devel@gnu.org; Mon, 14 Nov 2005 17:29:44 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Nov 2005 17:29:42 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 14 Nov 2005 17:29:42 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 37 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: <976C42B7-60B9-4A3A-8BC7-7FB81E2F5FE1@gmail.com> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:45959 gmane.emacs.help:31041 Archived-At: 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