From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#13815: Wrong mode for files with awkward shebang lines Date: Mon, 25 Feb 2013 22:02:22 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1361847804 14862 80.91.229.3 (26 Feb 2013 03:03:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Feb 2013 03:03:24 +0000 (UTC) Cc: 13815@debbugs.gnu.org To: Andrew Pennebaker Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 26 04:03:47 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UAApV-0005tS-VM for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Feb 2013 04:03:46 +0100 Original-Received: from localhost ([::1]:36603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAApB-0004sB-7F for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Feb 2013 22:03:25 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAAp8-0004rk-MR for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 22:03:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAAp5-0004Ee-Tc for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 22:03:22 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAAp5-0004Ea-Q9 for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 22:03:19 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UAAqj-0004TO-VP for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 22:05:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Feb 2013 03:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13815-submit@debbugs.gnu.org id=B13815.136184785117135 (code B ref 13815); Tue, 26 Feb 2013 03:05:01 +0000 Original-Received: (at 13815) by debbugs.gnu.org; 26 Feb 2013 03:04:11 +0000 Original-Received: from localhost ([127.0.0.1]:50256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAApt-0004SI-EB for submit@debbugs.gnu.org; Mon, 25 Feb 2013 22:04:11 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:51032) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAApq-0004S9-7r for 13815@debbugs.gnu.org; Mon, 25 Feb 2013 22:04:07 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1UAAoB-0006UH-0Z; Mon, 25 Feb 2013 22:02:23 -0500 X-Spook: fissionable UMTS Fortezza cryptographic Abbas ASLET X-Ran: Xgt}`U%UDS| List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:71820 Archived-At: 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