GNU bug report logs -
#1702
feature request: correctly display single file zip archive
Previous Next
Reported by: xah lee <xah <at> xahlee.org>
Date: Thu, 25 Dec 2008 18:40:04 UTC
Severity: wishlist
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #66 received at 1702 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Daniel Colascione <dancol <at> dancol.org> writes:
> On 11/14/2014 03:31 AM, Matthew Leach wrote:
>> Matthew Leach <matthew <at> mattleach.net> 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 <matthew <at> mattleach.net>
* arc-mode.el (archive-visit-single-files): New.
(archive-mode): Visit file if archive contains a single file.
[arc-single-file-mode.patch (text/x-diff, inline)]
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)
This bug report was last modified 10 years and 264 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.