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

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

Re: How to open a file in sh-mode


From: Henrik Austad
Subject: Re: How to open a file in sh-mode
Date: Thu, 14 Aug 2008 10:16:12 +0200
User-agent: KMail/1.9.9

On Thursday 14 August 2008 09:53:39 Francis Moreau wrote:
> Hello,
>
> I'm trying to open a file with emacs automatically set on sh-mode.
> The file name can't be used to guess that emacs should be in sh-mode
> when opening it.
>
> So I tried:
>
> $ emacs -f sh-mode foo
>
> But that doesn't work.
>
> Could anybody give me some advices ?

1) which version of emacs are you using?
2) is it a valid-sh file? i.e. does it start with #!/bin/bash on the first 
line?
3) have you enabled syntax-highlighting in the first place? 
if unsure, add
 (global-font-lock-mode t)
to your ~/.emacs 


I've testet a file foo with the following content

#!/bin/bash
echo "Hello World"

and emacs syntax-highlight this with versions 21, 22, 23.0.50 and 23.0.60 
(although I expect that if it works in one version, it'll work in all).


-- 
Med vennlig hilsen - Yours Sincerely
Henrik Austad




reply via email to

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