[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Major modes and features

From: Eric M. Ludlam
Subject: Major modes and features
Date: Fri, 16 Mar 2001 09:46:07 -0500

A recent post in gnu.emacs.bug got me thinking about major modes and
features.  By feature, I mean a tool like `imenu' or `font-lock'
which (provide ...)s something.

Speedbar keeps a regex which matches files which will contain tag able
text.  This falls behind as new languages and Imenu support is added.

Kevin Broady's recent request was for speedbar to somehow query
auto-mode-alist and compare that to some list of major modes to
determine if a given file supports imenu for tagging purposes.

That, of course, just pushes the maintenance out to a list of major

I would like to propose (for some future version of Emacs) that major
modes mark themselves as supporting a given feature with a symbol
property which can get picked up via ###autoload.  This would let
speedbar do a mapatoms across the global obarray for modes that
support imenu, cross ref that against auto-mode-alist, and ta-da, I
don't have to maintain anything, and mode authors to don't have to
email me, or add in some speedbar specific support code.

So, after that long-winded commentary, I suspect this could be useful
in other situations besides speedbar, though I can't think of any
just now.  What do others think?

Possible examples:
  (put 'c-mode 'imenu-support t)
  (put 'c-mode 'imenu t)
  (put 'c-mode 'supported-features
       (cons 'imenu (get 'c-mode 'supported-features)))
  (put 'imenu 'c-mode t)
  (put 'eric 'is-nutty t)

Is there a feature of `feature' that does something like this?


          Eric Ludlam:                 address@hidden, address@hidden
   Home: www.ultranet.com/~zappo            Siege: www.siege-engine.com
Emacs: http://cedet.sourceforge.net               GNU: www.gnu.org

reply via email to

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