]> code.delx.au - gnu-emacs/blobdiff - lisp/arc-mode.el
(hs-set-up-overlay): New user var.
[gnu-emacs] / lisp / arc-mode.el
index 2c2569bb970bdde79f8ac4b207f384857b9ba808..2cb20b4545deffb70a35d8ac5a8b47fd63267c27 100644 (file)
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1995, 1997, 1998, 2003 Free Software Foundation, Inc.
 
-;; Author: Morten Welinder <terra@diku.dk>
+;; Author: Morten Welinder <terra@gnu.org>
 ;; Keywords: archives msdog editing major-mode
 ;; Favourite-brand-of-beer: None, I hate beer.
 
@@ -815,6 +815,14 @@ using `make-temp-file', and the generated name is returned."
               (or (and archive-subfile-mode (aref archive-subfile-mode 0))
                   archive)))
          (make-directory archive-tmpdir t)
+         ;; If ARCHIVE includes leading directories, make sure they
+         ;; exist under archive-tmpdir.
+         (let ((arch-dir (file-name-directory archive)))
+           (if arch-dir
+               (make-directory (concat
+                                (file-name-as-directory archive-tmpdir)
+                                arch-dir)
+                               t)))
          (setq archive-local-name
                (archive-unique-fname archive-name archive-tmpdir))
          (save-restriction
@@ -894,8 +902,7 @@ using `make-temp-file', and the generated name is returned."
        (setq last-coding-system-used coding))
       (set-buffer-modified-p nil)
       (kill-local-variable 'buffer-file-coding-system)
-      (after-insert-file-set-buffer-file-coding-system (- (point-max)
-                                                         (point-min))))))
+      (after-insert-file-set-coding (- (point-max) (point-min))))))
 
 (defun archive-mouse-extract (event)
   "Extract a file whose name you click on."
@@ -1417,7 +1424,8 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
     (while (progn (goto-char p)                ;beginning of a base header.
                  (looking-at "\\(.\\|\n\\)\\(.\\|\n\\)-l[hz][0-9ds]-"))
       (let* ((hsize   (char-after p))  ;size of the base header (level 0 and 1)
-             (csize   (archive-l-e (+ p 7) 4)) ;size of a compressed file to follow.
+            (csize   (archive-l-e (+ p 7) 4)) ;size of a compressed file to follow (level 0 and 2),
+                                       ;size of extended headers + the compressed file to follow (level 1).
              (ucsize  (archive-l-e (+ p 11) 4))        ;size of an uncompressed file.
             (time1   (archive-l-e (+ p 15) 2)) ;date/time (MSDOS format in level 0, 1 headers
             (time2   (archive-l-e (+ p 17) 2)) ;and UNIX format in level 2 header.)
@@ -1516,8 +1524,12 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
                                   (length text))
                           visual)
              files (cons (vector prname ifnname fiddle mode (1- p))
-                          files)
-              p (+ p thsize 2 csize))))
+                          files))
+       (cond ((= hdrlvl 1)
+              (setq p (+ p hsize 2 csize)))
+             ((or (= hdrlvl 2) (= hdrlvl 0))
+              (setq p (+ p thsize 2 csize))))
+       ))
     (goto-char (point-min))
     (set-buffer-multibyte default-enable-multibyte-characters)
     (let ((dash (concat (if archive-alternate-display
@@ -1797,4 +1809,5 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
 
 (provide 'arc-mode)
 
+;;; arch-tag: e5966a01-35ec-4f27-8095-a043a79b457b
 ;;; arc-mode.el ends here