[Top][All Lists]

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

Re: How to open a file in sh-mode

From: Giorgos Keramidas
Subject: Re: How to open a file in sh-mode
Date: Thu, 14 Aug 2008 15:24:17 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix)

On Thu, 14 Aug 2008 12:06:59 +0200, "Francis Moreau" <address@hidden> wrote:
> On Thu, Aug 14, 2008 at 12:03 PM, Henrik Austad <address@hidden> wrote:
>> so basically, I think the question boils down to:
>> """
>> How do I create a hook in my .emacs so that all files starting with bash-fc-*
>> will load sh-mode?
>> """
> Well that would be the last thing I would do.
> My question is:
> """
> How do I start emacs in sh-mode from the shell with a file name
> appended at the end of the command
> """
> It doesn't seem to be all that complex !

You can probably write a short wrapper script that is used as $FCEDIT to
run the equivalent of:

    emacs --eval "(setq-default default-major-mode 'sh-mode)" file1 file2 ...

That's a bit like "cheating", but it does work.  You are essentially
firing up Emacs with a default-mode of `sh-mode' for new files, which
is nice for editing shell history output.

reply via email to

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