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

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

Re: hook and interactive with parameter


From: Emanuel Berg
Subject: Re: hook and interactive with parameter
Date: Tue, 13 Feb 2018 20:02:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Yuri Khan wrote:

> Option 1: Bind intero-mode to an easy key,
> such as <f9>. Press it after opening each
> file. In term of keypresses, pressing <f9> is
> not much worse than pressing “y” when you
> want to enable the mode, and not pressing
> <f9> is cheaper than pressing “n” when you
> don’t.

Yes, this is the best idea.

If you notice that for certain files
(particular files) you always do this, you can
use this

    (setq magic-mode-alist '(("/\\* cpp \\*/" . c++-mode)))

for those files, only adapted to Haskell, not
C++.

To test it, put

/* cpp */

as the first line in a file called cpp.txt -
now, the ".txt" extention should put the file
in text mode. But eval the above form, close
the file, and open it again - now it should be
in C++.

Magic :)

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

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