From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: sh-script.el and magic numbers Date: Tue, 21 Jan 2003 11:23:31 -0600 (CST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200301211723.LAA19391@eel.dms.auburn.edu> References: <200301190324.VAA14671@eel.dms.auburn.edu> <200301191247.h0JCl1Zs020036@beta.mvs.co.il> <8del78n1ks.fsf@ast.cam.ac.uk> <200301200759.h0K7xGOH007624@beta.mvs.co.il> <200301210045.SAA16966@eel.dms.auburn.edu> <388yxeu69x.fsf@ast.cam.ac.uk> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1043171777 9182 80.91.224.249 (21 Jan 2003 17:56:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 21 Jan 2003 17:56:17 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18b2dC-0002Ni-00 for ; Tue, 21 Jan 2003 18:56:14 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18b2of-0005Ee-00 for ; Tue, 21 Jan 2003 19:08:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18b2Ok-0004ta-06 for emacs-devel@quimby.gnus.org; Tue, 21 Jan 2003 12:41:18 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18b2Et-0001RP-00 for emacs-devel@gnu.org; Tue, 21 Jan 2003 12:31:07 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18b2AN-0000H5-00 for emacs-devel@gnu.org; Tue, 21 Jan 2003 12:26:28 -0500 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18b26u-0007mD-00 for emacs-devel@gnu.org; Tue, 21 Jan 2003 12:22:52 -0500 Original-Received: from eel.dms.auburn.edu (eel.dms.auburn.edu [131.204.53.108]) by manatee.dms.auburn.edu (8.9.1a/8.9.1) with ESMTP id LAA04237; Tue, 21 Jan 2003 11:22:51 -0600 (CST) Original-Received: (from teirllm@localhost) by eel.dms.auburn.edu (8.9.3+Sun/8.9.3) id LAA19391; Tue, 21 Jan 2003 11:23:31 -0600 (CST) X-Authentication-Warning: eel.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: gmorris+mail@ast.cam.ac.uk In-reply-to: (message from Glenn Morris on Tue, 21 Jan 2003 15:44:41 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10941 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10941 Glenn Morris wrote; No, I mean what was said in the thread I referred to, namely: # -*- mode: sh; sh-shell: csh; mode-line-process: "[csh]"-*- which works without the need for enabling eval of local variables. But it's a little ugly, and doesn't work right, since it still prints "indentation set up for shell type bash". I'd prefer just a single variable that controls what shell flavour a file is. That solution really does not seem solid at all. Not only is the indentation wrong, but moreover sh-shell is now csh, whereas sh-shell-file still has its usual value, in my case "/usr/local/bin/bash". This means half of sh-script.el thinks you are programming for csh and the other half thinks you are programming for bash. This is bad. I doubt that the problems caused by that are limited to the indentation problems (which are bad enough anyway.) I personally believe that the only solid way to switch shells is to call sh-set-shell. Otherwise, you have to emulate everything sh-set-shell does, including (run-hooks 'sh-set-shell-hook). This seems hopeless. Is having enable-local-eval set to maybe (the default-value) that bad? (It is not going to execute any evals without asking you.) If it is, one could have sh-mode look for a definition of sh-shell-file in the local variable line, if there is no magic number. Then you could just set sh-shell-file and sh-mode would itself call sh-set-shell with the desired argument. Can anybody think of a simple, but thoroughly solid, solution, not involving code changes, that works when enable-local-eval is nil? Sincerely, Luc.