From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: karl@freefriends.org (Karl Berry) Newsgroups: gmane.emacs.bugs Subject: bug#13006: recognizing compressed files with arbitrary names Date: Tue, 27 Nov 2012 01:31:51 GMT Message-ID: <201211270131.qAR1VpBY005753@freefriends.org> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1353979941 18136 80.91.229.3 (27 Nov 2012 01:32:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Nov 2012 01:32:21 +0000 (UTC) To: 13006@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 27 02:32:33 2012 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 1TdA2J-0005kq-3x for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Nov 2012 02:32:31 +0100 Original-Received: from localhost ([::1]:43754 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdA27-0006cZ-Uc for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Nov 2012 20:32:19 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdA25-0006cU-Pb for bug-gnu-emacs@gnu.org; Mon, 26 Nov 2012 20:32:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdA24-0000cS-Jh for bug-gnu-emacs@gnu.org; Mon, 26 Nov 2012 20:32:17 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdA24-0000cK-Fw for bug-gnu-emacs@gnu.org; Mon, 26 Nov 2012 20:32:16 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TdA3l-0005p9-R0 for bug-gnu-emacs@gnu.org; Mon, 26 Nov 2012 20:34:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: karl@freefriends.org (Karl Berry) Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Nov 2012 01:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13006 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.135398002622360 (code B ref -1); Tue, 27 Nov 2012 01:34:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Nov 2012 01:33:46 +0000 Original-Received: from localhost ([127.0.0.1]:40744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdA3V-0005ob-SH for submit@debbugs.gnu.org; Mon, 26 Nov 2012 20:33:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43164) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TdA3U-0005oU-5u for submit@debbugs.gnu.org; Mon, 26 Nov 2012 20:33:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdA1l-0000XT-LZ for submit@debbugs.gnu.org; Mon, 26 Nov 2012 20:31:58 -0500 Original-Received: from lists.gnu.org ([208.118.235.17]:53330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdA1l-0000XP-IU for submit@debbugs.gnu.org; Mon, 26 Nov 2012 20:31:57 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdA1k-0006bN-NV for bug-gnu-emacs@gnu.org; Mon, 26 Nov 2012 20:31:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdA1j-0000Wp-Fr for bug-gnu-emacs@gnu.org; Mon, 26 Nov 2012 20:31:56 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdA1j-0000Wl-Cy for bug-gnu-emacs@gnu.org; Mon, 26 Nov 2012 20:31:55 -0500 Original-Received: from [2001:4830:134:3::10] (port=60760 helo=eggs.gnu.org) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1TdA1i-0002sh-W0 for bug-emacs@gnu.org; Mon, 26 Nov 2012 20:31:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdA1h-0000WQ-Jx for bug-emacs@gnu.org; Mon, 26 Nov 2012 20:31:54 -0500 Original-Received: from frenzy.freefriends.org ([66.54.153.139]:54689 helo=freefriends.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdA1h-0000WG-Di for bug-emacs@gnu.org; Mon, 26 Nov 2012 20:31:53 -0500 X-Envelope-From: karl@freefriends.org X-Envelope-To: Original-Received: from freefriends.org (localhost [127.0.0.1]) by freefriends.org (8.14.5/8.14.5) with ESMTP id qAR1VqK3005755 for ; Mon, 26 Nov 2012 18:31:52 -0700 Original-Received: (from nobody@localhost) by freefriends.org (8.14.5/8.14.5/submit) id qAR1VpBY005753; Tue, 27 Nov 2012 01:31:51 GMT X-Authentication-Warning: frenzy.freefriends.org: nobody set sender to karl@freefriends.org using -f X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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.x 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:67495 Archived-At: As the documentation says (http://www.gnu.org/software/emacs/manual/html_node/emacs/Compressed-Files.html) "Emacs recognizes compressed files by their file names." But compressed files don't always have the expected names. For instance, using the autobackup feature of Emacs or many other programs will result in names ending in, say, .~1~ ... Example for concreteness: $ echo foo | gzip >/tmp/foo.gz.~1~ $ emacs --no-site-file --no-init /tmp/foo.gz.~1~ And observe binary junk instead of text. (This is with 24.2.) Another implication is problems using M-x grep on such files. After changing the program to zgrep from grep, matches in the *grep* buffer are displayed as usual, but then when one visits the file in Emacs, it's junk. It would be nice to at least have an easy way to manually tell Emacs "this is a compressed file, despite its weird name". If there's a way to do that now, I'd like to know (and it should presumably be in the manual). I looked at jka-compr.el but could not find it. Of course, a more robust solution would be to use magic numbers instead of filenames to recognize file types. I see there was a long thread about that several years ago, starting at http://lists.gnu.org/archive/html/emacs-devel/2009-08/msg01023.html. I know it's been discussed at other times, too, but I can't see any way to accomplish it (short of using crypt++, which doesn't work well with Emacs 23 or later, which is why I stopped using it ... anyway). Thanks, karl