From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: How to open a file in sh-mode Date: Thu, 14 Aug 2008 15:24:17 +0300 Organization: SunSITE.dk - Supporting Open source Message-ID: <874p5nwzri.fsf@kobe.laptop> References: <38b2ab8a0808140053g6261aeafmd74692199cea07eb@mail.gmail.com> <200808141016.12117.henrikau@stud.ntnu.no> <38b2ab8a0808140203s53c339f3k70d5887d42a4de2f@mail.gmail.com> <200808141203.22315.henrikau@stud.ntnu.no> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218717779 31637 80.91.229.12 (14 Aug 2008 12:42:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2008 12:42:59 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 14 14:43:49 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KTcAZ-0004fs-MT for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Aug 2008 14:43:11 +0200 Original-Received: from localhost ([127.0.0.1]:42932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTc9d-00057h-Br for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Aug 2008 08:42:13 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!newsfeed.straub-nv.de!noris.net!storethat.news.telefonica.de!telefonica.de!news-fra1.dfn.de!news.tele.dk!feed118.news.tele.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) Cancel-Lock: sha1:8/HhaAYJTGWGENfSsXEbZWhmNOQ= Original-Lines: 30 Original-NNTP-Posting-Host: 77.49.138.42 Original-X-Trace: news.sunsite.dk DXC=gJ^`5UR:UKAB^D; 0lZCOUDYSB=nbEKnkK4mi>jDOWoHGL^MjGbH?lJH1TkjLYRYbKeYiYkFS]3LlKZhhJI Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:161269 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:56615 Archived-At: On Thu, 14 Aug 2008 12:06:59 +0200, "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 ! 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.