Mailing List Archive


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

Re: [tlug] [X]Emacs file association (auto-mode)



>>>>> "Josh" == Josh Glover <jmglov@example.com> writes:

    Josh> But I don't want to have to add lines like this for each of
    Josh> my N file extensions. I would rather "strip" the .m4
    Josh> extension off of the end of the filename and let
    Josh> auto-mode-alist have at it.

Er, Josh, just how hard is it to type C-h v auto-mode-alist?  (Caveat,
theoretically this may be 21.5-specific, but I don't think so.)

auto-mode-alist
Documentation:
Alist of filename patterns vs. corresponding major mode functions.
Each element looks like (REGEXP . FUNCTION) or (REGEXP FUNCTION NON-NIL).
(NON-NIL stands for anything that is not nil; the value does not matter.)
Visiting a file whose name matches REGEXP specifies FUNCTION as the
mode function to use.  FUNCTION will be called, unless it is nil.

If the element has the form (REGEXP FUNCTION NON-NIL), then after
calling FUNCTION (if it's not nil), we delete the suffix that matched
REGEXP and search the list again for another match.

Ie, if ("\\.m4$" nil 'YOW!) doesn't do want you want, I want to hear
about it.

If it _does_ work, well, then

                           MERRY CHRISTMAS!

-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links