From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Perry Smith Newsgroups: gmane.emacs.help Subject: Re: how to map sh-mode to mean bash-mode Date: Sun, 17 Jul 2011 09:25:22 -0500 Message-ID: <812736AF-2EAB-4612-8371-70B47FAC1F7B@gmail.com> References: <87mxgfxfim.fsf@jidanni.org> <4E22AADE.1090701@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1310917431 28021 80.91.229.12 (17 Jul 2011 15:43:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 17 Jul 2011 15:43:51 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?iso-8859-1?Q?Andreas_R=F6hler?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 17 17:43:47 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QiTVS-00079n-UD for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jul 2011 17:43:47 +0200 Original-Received: from localhost ([::1]:44558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiTVR-0000TL-Ua for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jul 2011 11:43:46 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:52346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiSHg-00074z-Uo for help-gnu-emacs@gnu.org; Sun, 17 Jul 2011 10:25:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QiSHe-0003QG-1G for help-gnu-emacs@gnu.org; Sun, 17 Jul 2011 10:25:28 -0400 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:57691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QiSHd-0003Q6-O8 for help-gnu-emacs@gnu.org; Sun, 17 Jul 2011 10:25:25 -0400 Original-Received: by gyg13 with SMTP id 13so1155884gyg.0 for ; Sun, 17 Jul 2011 07:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=wJNxk8sV8oy06pt17u4ACKNKNP/tiWWYzGgmVN6VkDs=; b=jIkdjsN32o0VU6t85vcMy/QQ3LOiF2LhCfml6L06bf4OA9PENG4Dscc2t+5GGxyw+d SpHJgviC3FqYG1l+yiehm3i6nM/GRl8McV1nx5p94XcX4FYskzt5Rcuekm0qUbna1lKh tqF/wmmleyX+wa5ECMXN8BYxF9FhCw8FlrDqc= Original-Received: by 10.146.185.20 with SMTP id i20mr4689564yaf.14.1310912724956; Sun, 17 Jul 2011 07:25:24 -0700 (PDT) Original-Received: from [10.0.0.4] ([64.128.19.234]) by mx.google.com with ESMTPS id v20sm3493215ani.15.2011.07.17.07.25.23 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jul 2011 07:25:24 -0700 (PDT) In-Reply-To: <4E22AADE.1090701@easy-emacs.de> X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.160.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81630 Archived-At: On Jul 17, 2011, at 4:26 AM, Andreas R=F6hler wrote: > Am 16.07.2011 01:58, schrieb jidanni@jidanni.org: >> $ touch a.sh a.bash >> $ emacs -nw -Q a.bash a.sh >> See they are in different modeline modes? >> How can I make them both bash mode? >> No matter if it is filename prefix, or #!/bin/sh or whatever. >> I tried defalias, and it didn't work. >>=20 >>=20 >=20 > Hi, >=20 > AFAIU you want a bash-specific editing environment. > I'm interested in that question, as delivered some shell-script tools. > Maybe have a look at >=20 > sh-beg-end.el at https://launchpad.net/s-x-emacs-werkstatt/ >=20 > BTW, what should such bash-mode do, what sh-mode and shell-script-mode = do not? I'm curious on this too but... emacs looks at the #! line as well as the = suffix. So if you do: echo '#!/bin/bash' > f1.sh echo '#!/bin/bash' > f2.bash and then edit them, both put you into bash mode. And: echo '#!/bin/bash' > f3 (no suffix) will put you into bash mode too as well as echo '#!/usr/bin/env bash' > f4 (more complicated interpretation of the #! line) Likewise: echo '#!/usr/bin/env ruby' > f5 will put you into Ruby mode when editing f5. My curiosity is where is all this magic done so I could tweak it if I = needed to? I know about file-mode-alist but that is just the suffix = mapping part. What is interpreting the #! of a file? Thanks, pedz