From xemacs-m  Tue Feb 18 11:23:46 1997
Received: from steadfast.teradyne.com (steadfast.teradyne.com [131.101.1.200])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id LAA28901
	for <xemacs-beta@xemacs.org>; Tue, 18 Feb 1997 11:23:46 -0600 (CST)
Received: from engine.ecf.teradyne.com (engine.ecf.teradyne.com [131.101.192.6]) by steadfast.teradyne.com (8.7.1/8.7.1) with ESMTP id MAA06512 for <xemacs-beta@xemacs.org>; Tue, 18 Feb 1997 12:26:58 -0500 (EST)
Received: from midnight.eng.ecf.teradyne.com (midnight.ecf.teradyne.com [131.101.192.49]) by engine.ecf.teradyne.com (8.7.1/8.7.1) with SMTP id SAA29732 for <xemacs-beta@xemacs.org>; Tue, 18 Feb 1997 18:23:10 +0100 (MET)
Received: by midnight.eng.ecf.teradyne.com (SMI-8.6/SMI-SVR4)
	id SAA02350; Tue, 18 Feb 1997 18:23:10 +0100
Resent-Message-Id: <199702181723.SAA02350@midnight.eng.ecf.teradyne.com>
Sender: aichner@ecf.teradyne.com
Resent-To: xemacs-beta@xemacs.org
Resent-X-Face: 4[iHdXiTu\V3u[~\I)<f9HC);%~nG8`oUqv#uzvs6=\V{AjN6Sn
 c/qi;YLwRmEbt8Y*=j5n(urqY@chPh@J'D"QlqD!C8>*}#kYF[-tYl3VZga/HSOP|K,{L
 Rtu@f0y/=O&Cu}\:~d|P$JON?pn?j,&CnPb1z#/TL9bkAJwyol&a:SvYj-VYbM=Dtxhk9
 =w|R6U3_;SH&B<Mfy6Q%#
Resent-From: Adrian Aichner <aichner@ecf.teradyne.com>
Resent-Date: 18 Feb 1997 18:23:08 +0100
X-From-Line: aichner@engine.ecf.teradyne.com Tue Feb 18 18:17 MET 1997
Received: from midnight.eng.ecf.teradyne.com (midnight.ecf.teradyne.com [131.101.192.49]) by engine.ecf.teradyne.com (8.7.1/8.7.1) with SMTP id SAA29720; Tue, 18 Feb 1997 18:17:24 +0100 (MET)
Received: by midnight.eng.ecf.teradyne.com (SMI-8.6/SMI-SVR4)
	id SAA02341; Tue, 18 Feb 1997 18:17:24 +0100
To: Steven L Baur <steve@miranova.com>
Subject: Re: sh-mode won't choose correct interpreter automatically
References: <rxsu3nppsr4.fsf@midnight.ecf.teradyne.com> <m2zpx6wixx.fsf@altair.xemacs.org>
X-Face: 4[iHdXiTu\V3u[~\I)<f9HC);%~nG8`oUqv#uzvs6=\V{AjN6Sn
 c/qi;YLwRmEbt8Y*=j5n(urqY@chPh@J'D"QlqD!C8>*}#kYF[-tYl3VZga/HSOP|K,{L
 Rtu@f0y/=O&Cu}\:~d|P$JON?pn?j,&CnPb1z#/TL9bkAJwyol&a:SvYj-VYbM=Dtxhk9
 =w|R6U3_;SH&B<Mfy6Q%#
Mime-Version: 1.0 (generated by tm-edit 7.105)
From: Adrian Aichner <aichner@ecf.teradyne.com>
Date: 18 Feb 1997 18:17:22 +0100
In-Reply-To: Steven L Baur's message of 15 Feb 1997 00:51:38 -0800
Message-ID: <rxs3euuava5.fsf@midnight.ecf.teradyne.com>
X-Mailer: Red Gnus v0.84/XEmacs 20.1
Content-Type: text/plain; charset=US-ASCII
X-Content-Length: 2061
Lines: 71
Xref: midnight.ecf.teradyne.com mail.other:390
X-Gnus-Article-Number: 390   Tue Feb 18 18:18:17 1997

>>>>> "sb" == Steven L Baur <steve@miranova.com> writes:

    sb> Adrian Aichner writes:
    >> Hello sh-mode Supporters, Users,

    >> It is not possible to enter a file with a magic number and
    >> have sh-mode choose the correct type of shell from that magic number.

    >> The variable sh-shell-file will determine the type of shell to be
    >> used always.

    >> When switching to the shell of choice via
    >> M-x sh-set-shell 
    >> or
    >> C-c :
    >> font-lock-mode will be nuked by resetting font-lock-keywords, etc.

    sb> Yup.

    >> The correct shell syntax is now available but without font-lock
    >> support.

    >> Re-entering the file won't help, since sh-shell-file will determine
    >> the type of shell, not the file's magic number. End Of Story.

    >> Any help in sight?
    >> Any obvious mis-understanding on my part?

    sb> It looks like an incompatibility between the Emacsen.  I think I've
    sb> got this fixed in 19.15-b94 and 20.1-b1.

Hello Steven,

I can confirm that font-lock-mode now survives 
M-x sh-set-shell 
or
C-c :
in xemacs-20.1-b1.

However, the magic number will not be used to correctly set the proper
minor mode. I miss this feature bitterly, since my interactive shell
(as defined by env. var. SHELL) is csh but almost all shell scripts I
wrote are Bourne Shell and contain

#! /bin/sh
on the first line.

Still, shell-script-mode enters minor mode csh (although that is NOT
shown in the mode-line) instead of [sh].

I have investigated sh-script.el and executable.el but was not able
to figure out how this documented feature could have ever worked.

Any clues?

Thanks for the font-lock fix!

Adrian

    sb> -- 
    sb> steve@miranova.com baur
    sb> Unsolicited commercial e-mail will be billed at $250/message.



-- 
  Teradyne GmbH               Adrian Aichner Applications Engineer
  Semiconductor Test Group    Telephone      +49/89/418 61 (0)-208
  Dingolfinger Strasse 2      Fax            +49/89/418 61-217
  D-81673 M"UNCHEN            E-mail         aichner@ecf.teradyne.com

