all messages for Emacs-related lists mirrored at yhetil.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 18:26:15 -0600 (CST)	[thread overview]
Message-ID: <200301220026.SAA20752@eel.dms.auburn.edu> (raw)
In-Reply-To: <200301211723.LAA19391@eel.dms.auburn.edu> (message from Luc Teirlinck on Tue, 21 Jan 2003 11:23:31 -0600 (CST))

>From my earlier message:

   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.

I now believe that, if we absolutely want to handle the problem
without using a local eval, it would be better to have sh-mode, if
there is no magic number, add a buffer-local hook function to
find-file-hook.  That function would check the value of a buffer-local
variable, say sh-local-shell-file (or whatever), and, if the variable
is non-nil, call (sh-set-shell sh-local-shell-file).  This would
eliminate the need for the eval and

# <your comment> -*- mode: sh; sh-local-shell-file: /bin/csh; -*-

would work.  Defining sh-local-shell-file in a local variables list at
the end of the file would work too.

(The problem we want to circumvent is that file local variables get set
after the mode function has already ran.  So we use find-file-hook,
which runs after the local variables have been set.)

I am not going to worry further about implementation details before a
decision is made on whether this would be desirable.  Again, the only
purpose of this would be to avoid having to use a local eval.  If we
do not mind about using a local eval, all that is required is adding a
line or two to the mode's documentation string.

Sincerely,

Luc.

  parent reply	other threads:[~2003-01-22  0:26 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
2003-01-21 23:51                 ` Luc Teirlinck
2003-01-23  8:00                   ` Richard Stallman
2003-01-22  0:26                 ` Luc Teirlinck [this message]
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

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

  git send-email \
    --in-reply-to=200301220026.SAA20752@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.