GNU bug report logs - #13815
Wrong mode for files with awkward shebang lines

Previous Next

Package: emacs;

Reported by: Andrew Pennebaker <andrew.pennebaker <at> gmail.com>

Date: Tue, 26 Feb 2013 01:26:01 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: Andrew Pennebaker <andrew.pennebaker <at> gmail.com>
Cc: 13815 <at> debbugs.gnu.org
Subject: bug#13815: Wrong mode for files with awkward shebang lines
Date: Mon, 25 Feb 2013 22:02:22 -0500
Andrew Pennebaker wrote:

> #!/bin/sh
> exec scala "$0" "$@"
[...]
> This creates problems for Emacs, as Emacs uses `file` to detect which major
> mode should be used,

Emacs does not use `file', it uses interpreter-mode-alist (amongst other
things).

> This could be solved a variety of ways, but I think the simplest is to
> prioritize file extension over mimetype when a file extension is available.

It used to work that way prior to Emacs 22.1. Then it was changed for
reasons that were never properly explained IMO.

http://debbugs.gnu.org/3354

All you can do is add a mode: cookie.

Or use /usr/bin/env, IIUC
https://github.com/scala/scala/pull/9




This bug report was last modified 3 years and 268 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.