From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Francis Moreau" Newsgroups: gmane.emacs.help Subject: Re: How to open a file in sh-mode Date: Thu, 14 Aug 2008 11:03:07 +0200 Message-ID: <38b2ab8a0808140203s53c339f3k70d5887d42a4de2f@mail.gmail.com> References: <38b2ab8a0808140053g6261aeafmd74692199cea07eb@mail.gmail.com> <200808141016.12117.henrikau@stud.ntnu.no> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1218704804 16763 80.91.229.12 (14 Aug 2008 09:06:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2008 09:06:44 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Henrik Austad" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Aug 14 11:07:35 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 1KTYnk-0005Nn-Ai for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Aug 2008 11:07:25 +0200 Original-Received: from localhost ([127.0.0.1]:41163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTYmm-00024y-Po for geh-help-gnu-emacs@m.gmane.org; Thu, 14 Aug 2008 05:06:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTYjf-00018E-9K for help-gnu-emacs@gnu.org; Thu, 14 Aug 2008 05:03:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTYjd-00017b-K5 for help-gnu-emacs@gnu.org; Thu, 14 Aug 2008 05:03:10 -0400 Original-Received: from [199.232.76.173] (port=34486 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTYjd-00017R-31 for help-gnu-emacs@gnu.org; Thu, 14 Aug 2008 05:03:09 -0400 Original-Received: from rv-out-0708.google.com ([209.85.198.242]:56559) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTYjc-0000pM-EZ for help-gnu-emacs@gnu.org; Thu, 14 Aug 2008 05:03:08 -0400 Original-Received: by rv-out-0708.google.com with SMTP id k29so320995rvb.6 for ; Thu, 14 Aug 2008 02:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=kw4b8/nMc8O6cmrzA/QlGIsncwelJg3OZm2INnhpw1M=; b=I6mAhVwa/EFku4767I4G+u9xAiy6W/POk1J94zFi1l13uXyw7ON2GBkM2388cpx228 yMthXO/S78OcV/xdCuWWuTFMYaKuSTgwn6vR1aWQePQvUrK003rL/MIK+t0gRJynH+jo dvWcx62bnYoMg4QAg6WCJTftN+JJo3y+uvYEg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=xxwa7wRIy25GmY0pI4Rcwb/aq7cuxsEMDapwHrF6BojbRMOEiWND7tJRESdESjWrf7 gujqrKyAIcbnEAV1riAQ+qu/7B9VUPjOKmzfZCh31cXi/3lvGsYbYQ5EOZZNdO4MIHRr 7cl+5dEzeNSjB5dxnklXsI0SUg7XoPQ9O7/ec= Original-Received: by 10.141.153.16 with SMTP id f16mr467182rvo.17.1218704587525; Thu, 14 Aug 2008 02:03:07 -0700 (PDT) Original-Received: by 10.140.170.16 with HTTP; Thu, 14 Aug 2008 02:03:07 -0700 (PDT) In-Reply-To: <200808141016.12117.henrikau@stud.ntnu.no> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:56595 Archived-At: On Thu, Aug 14, 2008 at 10:16 AM, Henrik Austad wrote: > 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? No, it's actually the file created by fc(1) to edit the bash history. It uses the FCEDIT env variable to launch the editor it going to use. So I'd like to set it to: export FCEDIT="emacs -f sh-mode" so that fc(1) uses emacs as editor in sh-mode directly. Note that the name of the temporary file is *appended* to what you specified in FCEDIT. -- Francis