bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#11434: 24.0.96; Determining major mode for a given file extension


From: Stefan Monnier
Subject: bug#11434: 24.0.96; Determining major mode for a given file extension
Date: Tue, 08 May 2012 14:24:19 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

>> For now, I propose to rename it
>> "*coffee-compiled*.js", but I'd appreciate suggestions as to how I could
>> do this better. It would be nice to be able to give set-auto-mode a
>> clue, in the form of a filename or an interpreter name, for cases like this.

> Since it's the file name, not the buffer name, that matters, my
> current solution is to do:

>   (setq buffer-file-name "compiled.js")
>   (set-auto-mode)
>   (setq buffer-file-name nil)

> Does that seem reasonable?

I'd use (let ((buffer-file-name "foo.js")) (set-auto-mode)) instead.


        Stefan





reply via email to

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