On Thursday 14 August 2008 12:06:59 Francis Moreau wrote: > On Thu, Aug 14, 2008 at 12:03 PM, Henrik Austad 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 ! ok, I think I got something that works, thanks to all the guys at #emacs for this (ams, pgas, bpalmer) In .emacs add the following: (add-to-list 'auto-mode-alist '("bash-fc" . sh-mode)) then; export FCEDIT="emacs" then sh-mode will be loaded when you open files starting with bash-fc as a test; echo "Hello World" && fc -- mvh Henrik Austad