emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 01/01: Fix bug #1702 with missing feature in arc-mo


From: Eli Zaretskii
Subject: [Emacs-diffs] master 01/01: Fix bug #1702 with missing feature in arc-mode.el.
Date: Fri, 21 Nov 2014 10:09:20 +0000

branch: master
commit 48039f4b4c8f7651a56e5b61612aac64585a790a
Author: Matthew Leach <address@hidden>
Date:   Fri Nov 21 12:08:00 2014 +0200

    Fix bug #1702 with missing feature in arc-mode.el.
    
     lisp/arc-mode.el (archive-visit-single-files): New.
     (archive-mode): Visit file if archive contains a single file.
---
 lisp/ChangeLog   |    6 ++++++
 lisp/arc-mode.el |   16 +++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9d5d727..4169e83 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-13  Matthew Leach  <address@hidden>
+
+       * arc-mode.el (archive-visit-single-files): New.
+       (archive-mode): Visit file if archive contains a single file.
+       (Bug#1702)
+
 2014-11-21  Ulrich Müller  <address@hidden>
 
        * vc/vc.el: Fix a typo in the commentary.
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index a9f0ec7..df04521 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]