From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Heuristics for: is a major-mode a "programming language" mode? Date: Wed, 15 Sep 2010 16:27:19 +0200 Organization: A noiseless patient Spider Message-ID: References: <87tylrup5r.fsf@puma.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291866847 1433 80.91.229.12 (9 Dec 2010 03:54:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 03:54:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 04:54:03 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQXZy-00077p-8r for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 04:54:02 +0100 Original-Received: from localhost ([127.0.0.1]:50720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQXZx-0008VT-Er for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 22:54:01 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Injection-Date: Wed, 15 Sep 2010 14:27:19 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="xDHsy1x9NE+TbkG1x7hofg"; logging-data="25862"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BAA/rBLaVgY5vVGFHwDo7" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:lFrYXrt6UjqfAymCclGoOZFdgK8= sha1:6/oAHJHTf4hOCwqkjiBTrU/Zwm0= Original-Xref: usenet.stanford.edu gnu.emacs.help:181326 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:76590 Archived-At: > Not sure if this will help, but in current emacs 24, there is note in > the NEWS file about a new mode called prog-mode, which is supposed to be > a parent mode for programming modes. I believe the supplied prog modes > in emacs have/are being updated to be derived from this mode. Indeed, this prog-mode should provide just the info that Ilya needs, except that: - it'll be new in Emacs-24.1, so it's not a good solution for "right now" - only some of the major modes distributed with Emacs have been updated to use it, as of now. Hopefully by 24.1 they will "all" have been adapted. - non-bundled programming modes probably take a lot longer to start using it. In the mean time, for modes bundled with Emacs, a good heuristic could be to try and find the file from which the mode was loaded and then see if that file is in "lisp/progmodes/" or elsewhere. And of course that will have some false positives (e.g. inferior-process interaction modes) and false negatives (lisp-mode.el which i still in lisp/emacs-lisp). And then come the ambiguous ones, like sgml-mode and latex-mode which can be considered both as programming modes and text modes (they currently inherit from text-mode only, tho). Stefan