autoconf-patches
[Top][All Lists]
Advanced

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

Re: FYI: Emacs modes


From: Russ Allbery
Subject: Re: FYI: Emacs modes
Date: 28 Sep 2001 11:36:26 -0700
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

Akim Demaille <address@hidden> writes:

> Also, I don't know what should be done to trigger the mode
> automatically,

Generally you want something like:

  (autoload 'autoconf-mode "autoconf-mode"
            "Major mode for editing autoconf files." t)
  (setq auto-mode-alist
        (cons '("\\.ac\\'\\|configure\\.in\\'" . autoconf-mode)
              auto-mode-alist))

  (autoload 'autotest-mode "autotest-mode"
            "Major mode for editing autotest files." t)
  (setq auto-mode-alist
        (cons '("\\.at\\'" . autotest-mode) auto-mode-alist))

The automatic mode logic in emacs is generally based on a regex match of
the file name (with the -*- magic or file local variables overriding, of
course).  You may want to fiddle with the above regexes; I don't know that
much about the file naming conventions of autoconf and autotest files.
It's not clear to me, for example, whether people would prefer .m4 files
be loaded in autoconf mode or m4 mode; I'm guessing that you may want to
mention that as something people may want to customize.

\' is the emacs regex equivalent of $ without matching before any newline
(so it does the right thing with file names containing newlines whereas $
won't).  It's like the Perl \z.

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>



reply via email to

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