emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#17332: closed (sh-mode: File local variables ignor


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#17332: closed (sh-mode: File local variables ignored for setting shell variant)
Date: Thu, 24 Apr 2014 01:02:02 +0000

Your message dated Thu, 24 Apr 2014 11:00:44 +1000
with message-id <address@hidden>
and subject line erroneous report
has caused the debbugs.gnu.org bug report #17332,
regarding sh-mode: File local variables ignored for setting shell variant
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
17332: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17332
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: sh-mode: File local variables ignored for setting shell variant Date: Thu, 24 Apr 2014 10:07:24 +1000 User-agent: Mutt/1.5.23 (2014-03-12)
Howdy,

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.

Emacs allows me to specify that a shell include file should be opened
in sh mode, by setting a local variable in the editor hints::

    # Local variables:
    # coding: utf-8
    # mode: sh
    # End:
    # vim: fileencoding=utf-8 filetype=bash :

I can specify to Vim that the file's shell variant is specifically
Bash, and it obeys the editor hint to present specific Bash syntax
highlighting. But Emacs has ‘sh’ mode which covers all shell variants.

The ‘sh’ mode will properly interpret such a file if it has a shebang
line (e.g. #! /bin/bash). But some files are not stand-alone programs,
so I do not want those to have a shebang line.

Emacs ‘sh’ mode treats those files as Posix shell syntax, which they
are not. ‘sh’ mode has the concept of “variant” of shell syntax; but
I'm unable to find out how to specify, in the file's editor hints,
which variant to use for the file.

How can I set the Emacs editor hints in the file such that, when the
file is opened, ‘sh’ mode knows that its syntax is Bash, or Zsh, etc.?

-- 
 \       “If consumers even know there's a DRM, what it is, and how it |
  `\     works, we've already failed.” —Peter Lee, Disney corporation, |
_o__)                                                             2005 |
Ben Finney <address@hidden>

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message --- Subject: erroneous report Date: Thu, 24 Apr 2014 11:00:44 +1000 User-agent: Mutt/1.5.23 (2014-03-12)
Closing this report, which was erroneously submitted without a
pseudo-header.

-- 
 \            “Human reason is snatching everything to itself, leaving |
  `\           nothing for faith.” —Bernard of Clairvaux, 1090–1153 CE |
_o__)                                                                  |
Ben Finney <address@hidden>

Attachment: signature.asc
Description: Digital signature


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]