unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: sh-script.el and magic numbers
Date: Tue, 21 Jan 2003 11:23:31 -0600 (CST)	[thread overview]
Message-ID: <200301211723.LAA19391@eel.dms.auburn.edu> (raw)
In-Reply-To: <n165si33ti.fsf@ast.cam.ac.uk> (message from Glenn Morris on Tue, 21 Jan 2003 15:44:41 +0000)

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.

  parent reply	other threads:[~2003-01-21 17:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-19  3:24 sh-script.el and magic numbers Luc Teirlinck
2003-01-19 12:47 ` Ehud Karni
2003-01-19 23:48   ` Glenn Morris
2003-01-20  7:59     ` Ehud Karni
2003-01-21  0:45       ` Luc Teirlinck
2003-01-21 10:49         ` Glenn Morris
2003-01-21 15:30           ` Luc Teirlinck
2003-01-21 15:44             ` Glenn Morris
2003-01-21 16:04               ` Luc Teirlinck
2003-01-21 17:23               ` Luc Teirlinck [this message]
2003-01-21 23:51                 ` Luc Teirlinck
2003-01-23  8:00                   ` Richard Stallman
2003-01-22  0:26                 ` Luc Teirlinck
2003-01-21 16:54           ` Kai Großjohann
2003-01-21 19:29             ` Luc Teirlinck
2003-01-21 20:00               ` Kai Großjohann
2003-01-22  8:41               ` Kai Großjohann
2003-01-22 14:18                 ` Luc Teirlinck
2003-01-22 20:51                   ` Luc Teirlinck
2003-01-23  1:12                   ` Kevin Rodgers
2003-01-20 16:45   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200301211723.LAA19391@eel.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).