all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ben Finney <ben+gnu@benfinney.id.au>
To: Glenn Morris <rgm@gnu.org>
Cc: 17333@debbugs.gnu.org
Subject: bug#17333: sh-mode: File local variables for setting shell variant
Date: Wed, 30 Apr 2014 11:01:55 +1000	[thread overview]
Message-ID: <20140430010154.GA7043@benfinney.id.au> (raw)
In-Reply-To: <1kr44gkyho.fsf@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1371 bytes --]

On 29-Apr-2014, Glenn Morris wrote:
> Ben Finney wrote:
> 
> > The 'sh-mode' appears to have no means for allowing a
> > non-executable file to declare, in its local variables, the shell
> > variant to use for syntax.
> 
> I'd also like a way to do this.
> In the past I've used
> 
> -*- mode: sh; eval: (sh-set-shell "tcsh" nil nil) -*-
> 
> but it is not great.

Partly because, AIUI, having ‘eval’ in the file's local variables is a
security hole, and is often disabled.

> Ideas that come to mind are a bunch of aliases (sh-bash-mode etc) that
> DTRT (yuck?); or sh-mode could add something to
> hack-local-variables-hook that respects a file-local `sh-buffer-shell'
> or somesuch.

I'd expect to be able to set the shell variant similar to the way that
I can set the SQL dialect::

    # Local variables:
    # coding: utf-8
    # mode: sql
    # sql-product: postgres
    # End:

So, for example::

    # Local variables:
    # coding: utf-8
    # mode: sh
    # shell-variant: bash
    # End:

would be a good interface for this feature, IMO.

-- 
 \     “I went to the cinema, it said ‘Adults: $5.00, Children $2.50’. |
  `\          So I said ‘Give me two boys and a girl.’” —Steven Wright |
_o__)                                                                  |
Ben Finney <ben@benfinney.id.au>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      parent reply	other threads:[~2014-04-30  1:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-24  0:40 bug#17333: sh-mode: File local variables for setting shell variant Ben Finney
2014-04-29 14:21 ` Glenn Morris
2014-04-29 15:40   ` Stefan Monnier
2014-04-30  1:17     ` Ben Finney
2014-05-22 20:42     ` Glenn Morris
2014-04-30  1:01   ` Ben Finney [this message]

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=20140430010154.GA7043@benfinney.id.au \
    --to=ben+gnu@benfinney.id.au \
    --cc=17333@debbugs.gnu.org \
    --cc=rgm@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.