memnus: Ray tracing of three bars passing through a sphere (graphics)
Brian ([personal profile] memnus) wrote2006-11-30 09:58 pm
Entry tags:

Dear Lazyweb

Preface: I have a hard time with the documentation of just about every GNU program I've ever tried to read, so never mind the RTFMs. I'm also too busy with actual work to try to dig this up.

Question: What magic line do I put into a .emacs file to tell it that all files of a certain extension should be read in a certain way? I'd like to apply C-mode syntax highlighting to all *.glsl files I open, without having to type `M-X c-mode' each time I open one.

Thank you,
Brian

click

[identity profile] iluvsheep.livejournal.com 2006-12-02 04:27 am (UTC)(link)
I honestly can't believe that I am the first one to get to this.

Anyway, I don't understand it either, but here's the magical code that makes files ending in '.conf' and '.esp' load in perl-mode by default.

(setq auto-mode-alist
      (append '(
        ("\\.conf$" . perl-mode)
        ("\\.esp$" . perl-mode)
        )
          auto-mode-alist))


If you want to do it for all files:

(setq default-major-mode 'perl-mode)

[identity profile] memnus.livejournal.com 2006-12-02 10:01 pm (UTC)(link)
Bingo, that's got it. Thanks!