From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Leach Newsgroups: gmane.emacs.bugs Subject: bug#1702: [PATCH]: feature request: correctly display single file zip archive Date: Tue, 18 Nov 2014 20:12:25 +0000 Message-ID: <87y4r8i7yu.fsf@loki.home> References: <87lju1hv7b.fsf@cyd.mit.edu> <13EFAAB6-C6B3-4F67-A39A-5266E91A0CD5@xahlee.org> <87wq6zj66o.fsf_-_@loki.home> <83ppcrj5ot.fsf@gnu.org> <87r3x6kilm.fsf@loki.home> <83lhnekhyp.fsf@gnu.org> <87mw7ukgvf.fsf@loki.home> <83h9y2kfva.fsf@gnu.org> <87a93ukepe.fsf@loki.home> <83d28qjqs2.fsf@gnu.org> <87sihmjb22.fsf@mattleach.net> <87lhnej9wu.fsf@mattleach.net> <546B43F6.8040207@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1416341605 11775 80.91.229.3 (18 Nov 2014 20:13:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Nov 2014 20:13:25 +0000 (UTC) Cc: xah@xahlee.org, 1702@debbugs.gnu.org, cyd@stupidchicken.com To: Daniel Colascione Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 18 21:13:18 2014 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 1Xqp9K-0003fr-0O for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Nov 2014 21:13:18 +0100 Original-Received: from localhost ([::1]:55152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqp9J-0003sR-IA for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Nov 2014 15:13:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqp9A-0003o9-Ef for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 15:13:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xqp94-0006UN-P9 for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 15:13:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xqp94-0006UJ-M8 for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 15:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xqp94-0006Ub-A5 for bug-gnu-emacs@gnu.org; Tue, 18 Nov 2014 15:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matthew Leach Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Nov 2014 20:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1702 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 1702-submit@debbugs.gnu.org id=B1702.141634154924913 (code B ref 1702); Tue, 18 Nov 2014 20:13:02 +0000 Original-Received: (at 1702) by debbugs.gnu.org; 18 Nov 2014 20:12:29 +0000 Original-Received: from localhost ([127.0.0.1]:37575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xqp8X-0006Tl-58 for submit@debbugs.gnu.org; Tue, 18 Nov 2014 15:12:29 -0500 Original-Received: from mx0.mattleach.net ([176.58.118.143]:60146) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xqp8V-0006Td-7H for 1702@debbugs.gnu.org; Tue, 18 Nov 2014 15:12:27 -0500 Original-Received: by mx0.mattleach.net (Postfix, from userid 99) id E18E061ACC; Tue, 18 Nov 2014 20:12:26 +0000 (GMT) Original-Received: from loki.home.mattleach.net (host86-157-143-67.range86-157.btcentralplus.com [86.157.143.67]) by mx0.mattleach.net (Postfix) with ESMTPSA id 2907161ABC; Tue, 18 Nov 2014 20:12:26 +0000 (GMT) In-Reply-To: <546B43F6.8040207@dancol.org> (Daniel Colascione's message of "Tue, 18 Nov 2014 05:04:54 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.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:96210 --=-=-= Content-Type: text/plain Daniel Colascione writes: > On 11/14/2014 03:31 AM, Matthew Leach wrote: >> Matthew Leach writes: >> > > I don't think the new behavior should be the default. It seems as though that is the consensus. Revised patch included that turns off the feature by default. Thanks, Matt lisp/ChangeLog: 2014-11-13 Matthew Leach * arc-mode.el (archive-visit-single-files): New. (archive-mode): Visit file if archive contains a single file. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=arc-single-file-mode.patch diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index ef155ee..9833c90 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -147,6 +147,15 @@ A local copy of the archive will be used when updating." "Hook run when an archive member has been extracted." :type 'hook :group 'archive) + +(defcustom archive-visit-single-files nil + "If non-nil, opening an archive with a single file visits that file. + + If this option's value is nil, visiting such archives will + display the archive summary." + :type '(choice (const :tag "Visit the single file" t) + (const :tag "Show the archive summary" nil)) + :group 'archive) ;; ------------------------------ ;; Arc archive configuration @@ -742,7 +751,12 @@ archive. (if (default-value 'enable-multibyte-characters) (set-buffer-multibyte 'to)) (archive-summarize nil) - (setq buffer-read-only t)))) + (setq buffer-read-only t) + (when (and archive-visit-single-files + auto-compression-mode + (= (length archive-files) 1)) + (rename-buffer (concat " " (buffer-name))) + (archive-extract))))) ;; Archive mode is suitable only for specially formatted data. (put 'archive-mode 'mode-class 'special) --=-=-=--