[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Heuristics for: is a major-mode a "programming language" mode?
From: |
Stefan Monnier |
Subject: |
Re: Heuristics for: is a major-mode a "programming language" mode? |
Date: |
Wed, 08 Dec 2010 15:28:39 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> 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