GNU bug report logs - #10506
24.0.92; Visiting the Guile v2.0.3 tarball shows binary garbage

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Sat, 14 Jan 2012 21:12:01 UTC

Severity: normal

Merged with 10601

Found in version 24.0.92

Fixed in version 24.0.93

Done: Glenn Morris <rgm <at> gnu.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: Eli Zaretskii <eliz <at> gnu.org>
Cc: 10506 <at> debbugs.gnu.org
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
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?




This bug report was last modified 13 years and 122 days ago.

Previous Next


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