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#10506: 24.0.92; Visiting the Guile v2.0.3 tarball shows binary garbage Date: Tue, 17 Jan 2012 20:27:52 -0500 Message-ID: References: <83ty3yhtxj.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1326850091 29650 80.91.229.12 (18 Jan 2012 01:28:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 18 Jan 2012 01:28:11 +0000 (UTC) Cc: 10506@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 18 02:28:07 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RnKJp-0003IE-3d for geb-bug-gnu-emacs@m.gmane.org; Wed, 18 Jan 2012 02:28:05 +0100 Original-Received: from localhost ([::1]:53034 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnKJo-0003Fm-Ab for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Jan 2012 20:28:04 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnKJl-0003Fe-Ob for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2012 20:28:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnKJj-0004Jj-PD for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2012 20:28:01 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnKJj-0004Jf-MP for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2012 20:27:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RnKKk-0001eV-5K for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2012 20:29:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <83ty3yhtxj.fsf@gnu.org> Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Jan 2012 01:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10506 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10506-submit@debbugs.gnu.org id=B10506.13268501396342 (code B ref 10506); Wed, 18 Jan 2012 01:29:02 +0000 Original-Received: (at 10506) by debbugs.gnu.org; 18 Jan 2012 01:28:59 +0000 Original-Received: from localhost ([127.0.0.1]:34009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RnKKg-0001eD-Bb for submit@debbugs.gnu.org; Tue, 17 Jan 2012 20:28:59 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]:40625) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RnKKd-0001e6-Ja for 10506@debbugs.gnu.org; Tue, 17 Jan 2012 20:28:56 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RnKJc-00065v-4j; Tue, 17 Jan 2012 20:27:52 -0500 X-Spook: brigand bullion Attorney General MD5 IMF colonel CIA X-Ran: >heNAskl2jVCvh$^A@8f}W'QqS!06F([LPj=rS:3CT];\.e.duv9)crN\Xf/T)%Lu:VWA" X-Hue: yellow X-Attribution: GM User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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:55833 Archived-At: Eli Zaretskii wrote: >> It happens to contain a shell-script (depcomp) near the end of the >> tarfile, and that shell-script happens to have a footer that starts >> fewer than 3000 characters from the end of the tarfile, and happens to >> contain: >> >> # Local Variables: >> # mode: shell-script [...] > But this is a regression from Emacs 23.3, which doesn't have this > problem. The change is because set-auto-mode now checks for "mode:" at the end of the file earlier than it did in 23.3 (specifically, before auto-mode-alist). This is for correct handling of some dir-local variables (bug#8586), but also seems like the right thing to do in general. It is however wrong in this specific instance, and in other instances of binary files. It works in 23.3 because auto-mode-alist is consulted first, chooses tar-mode, and this then binds local-enable-local-variables to nil. I was going to say that I think it would still go wrong in 23.3 if you could somehow construct a tar file with a -*- mode -*- entry on the first line, but then I discovered inhibit-first-line-modes-regexps. I think the right solution is to extend the meaning of inhibit-first-line-modes-regexps, so that we ignore mode: entries (indeed, all file local variables) in matching files wherever they appear (not just the first line). IMO, this is obviously the sense in which one would want to use such a variable - I can't think of a case where one would want to ignore mode in the first line, but respect it at the end, or ignore all mode: settings but still respect other file local variables. This variable is not documented in the manual, so I would not feel too bad about extending it in this way; it's just a shame that it has the name it does. A final comment: it seems to me that anything in auto-coding-alist with a no-conversion* coding should be in inhibit-first-line-modes-regexps as well, since the meaning in both cases is basically "this is a binary file". Are there any exceptions? Thoughts?