emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/arc-mode.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/arc-mode.el,v
Date: Thu, 03 Apr 2008 20:05:42 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/04/03 20:05:42

Index: arc-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/arc-mode.el,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- arc-mode.el 6 Mar 2008 22:11:11 -0000       1.88
+++ arc-mode.el 3 Apr 2008 20:05:38 -0000       1.89
@@ -358,6 +358,8 @@
     (define-key map "M" 'archive-chmod-entry)
     (define-key map "G" 'archive-chgrp-entry)
     (define-key map "O" 'archive-chown-entry)
+    ;; Let mouse-1 follow the link.
+    (define-key map [follow-link] 'mouse-face)
 
     (if (fboundp 'command-remapping)
         (progn
@@ -892,6 +894,26 @@
 ;; -------------------------------------------------------------------------
 ;;; Section: Member extraction
 
+(defun archive-try-jka-compr ()
+  (when (and auto-compression-mode
+             (jka-compr-get-compression-info buffer-file-name))
+    (let* ((basename (file-name-nondirectory buffer-file-name))
+           (tmpname (if (string-match ":\\([^:]+\\)\\'" basename)
+                        (match-string 1 basename) basename))
+           (tmpfile (make-temp-file (file-name-sans-extension tmpname)
+                                    nil
+                                    (file-name-extension tmpname 'period))))
+      (unwind-protect
+          (progn
+            (let ((coding-system-for-write 'no-conversion)
+                  ;; Don't re-compress this data just before decompressing it.
+                  (jka-compr-inhibit t))
+              (write-region (point-min) (point-max) tmpfile nil 'quiet))
+            (erase-buffer)
+            (let ((coding-system-for-read 'no-conversion))
+              (insert-file-contents tmpfile)))
+        (delete-file tmpfile)))))
+
 (defun archive-file-name-handler (op &rest args)
   (or (eq op 'file-exists-p)
       (let ((file-name-handler-alist nil))
@@ -921,12 +943,11 @@
                 (car (find-operation-coding-system
                       'insert-file-contents
                       (cons filename (current-buffer)) t))))))
-      (if (and (not coding-system-for-read)
-              (not enable-multibyte-characters))
+      (unless (or coding-system-for-read
+                  enable-multibyte-characters)
          (setq coding
                (coding-system-change-text-conversion coding 'raw-text)))
-      (if (and coding
-              (not (eq coding 'no-conversion)))
+      (unless (memq coding '(nil no-conversion))
          (decode-coding-region (point-min) (point-max) coding)
        (setq last-coding-system-used coding))
       (set-buffer-modified-p nil)
@@ -999,6 +1020,7 @@
              (progn
                (set-buffer-modified-p nil)
                (kill-buffer buffer))
+            (archive-try-jka-compr)     ;Pretty ugly hack :-(
            (archive-set-buffer-as-visiting-file ename)
            (goto-char (point-min))
            (rename-buffer bufname)
@@ -2088,7 +2110,7 @@
           (with-current-buffer destbuf
             ;; Do it within the `widen'.
             (insert-buffer-substring archivebuf from (+ from size)))
-          (set-buffer-multibyte t)
+          (set-buffer-multibyte 'to)
           ;; Inform the caller that the call succeeded.
           t)))))
 




reply via email to

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