aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-03-26 01:19:50 +0000
committerStefan Monnier2009-03-26 01:19:50 +0000
commit3835d0d099311dc2cc1e6a48b8b9c5a4bb0fb14a (patch)
tree3db5057129c23c23235c21f05caf4a3ce704b033
parentb74d950615765532ad8b4581056b1340649fd0b8 (diff)
downloademacs-3835d0d099311dc2cc1e6a48b8b9c5a4bb0fb14a.tar.gz
emacs-3835d0d099311dc2cc1e6a48b8b9c5a4bb0fb14a.zip
(archive-ar-summarize): Don't burp on special GNU
extension entries for lookup tables or extended file name tables. Distinguish the internal and external name, so lookup is easier. (archive-ar-extract): Take advantage of more precise name. Preserve point.
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/arc-mode.el95
2 files changed, 59 insertions, 52 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1f462a1fe0b..ec4cff9df1a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12009-03-26 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * arc-mode.el (archive-ar-summarize): Don't burp on special GNU
4 extension entries for lookup tables or extended file name tables.
5 Distinguish the internal and external name, so lookup is easier.
6 (archive-ar-extract): Take advantage of more precise name.
7 Preserve point.
8
12009-03-25 Chong Yidong <cyd@stupidchicken.com> 92009-03-25 Chong Yidong <cyd@stupidchicken.com>
2 10
3 * play/bubbles.el (bubbles): Doc fix (Bug#2776). 11 * play/bubbles.el (bubbles): Doc fix (Bug#2776).
@@ -56,8 +64,8 @@
56 64
572009-03-21 Eli Zaretskii <eliz@gnu.org> 652009-03-21 Eli Zaretskii <eliz@gnu.org>
58 66
59 * eshell/em-ls.el (eshell-ls-dir): Call 67 * eshell/em-ls.el (eshell-ls-dir):
60 eshell-directory-files-and-attributes with additional argument 68 Call eshell-directory-files-and-attributes with additional argument
61 'integer or 'string, according to numeric-uid-gid. 69 'integer or 'string, according to numeric-uid-gid.
62 (eshell-ls-file): Don't convert UID and GID to strings, as 70 (eshell-ls-file): Don't convert UID and GID to strings, as
63 eshell-ls-dir already did. Enlarge max user-name string length to 71 eshell-ls-dir already did. Enlarge max user-name string length to
@@ -66,8 +74,8 @@
66 74
67 * eshell/esh-util.el (directory-files-and-attributes): Accept and 75 * eshell/esh-util.el (directory-files-and-attributes): Accept and
68 ignore additional optional argument id-format. 76 ignore additional optional argument id-format.
69 (eshell-directory-files-and-attributes): Call 77 (eshell-directory-files-and-attributes):
70 directory-files-and-attributes with additional argument id-format. 78 Call directory-files-and-attributes with additional argument id-format.
71 79
72 * eshell/em-ls.el (eshell-ls-file): Enlarge default size-width to 8. 80 * eshell/em-ls.el (eshell-ls-file): Enlarge default size-width to 8.
73 (eshell-ls-dir): Under -l, call eshell-ls-printable-size with last 81 (eshell-ls-dir): Under -l, call eshell-ls-printable-size with last
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index d3e4c9f3e36..cc59d6e5678 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -2015,6 +2015,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
2015 (search-forward "!<arch>\n") 2015 (search-forward "!<arch>\n")
2016 (while (looking-at archive-ar-file-header-re) 2016 (while (looking-at archive-ar-file-header-re)
2017 (let ((name (match-string 1)) 2017 (let ((name (match-string 1))
2018 extname
2018 ;; Emacs will automatically use float here because those 2019 ;; Emacs will automatically use float here because those
2019 ;; timestamps don't fit in our ints. 2020 ;; timestamps don't fit in our ints.
2020 (time (string-to-number (match-string 2))) 2021 (time (string-to-number (match-string 2)))
@@ -2024,35 +2025,33 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
2024 (size (string-to-number (match-string 6)))) 2025 (size (string-to-number (match-string 6))))
2025 ;; Move to the beginning of the data. 2026 ;; Move to the beginning of the data.
2026 (goto-char (match-end 0)) 2027 (goto-char (match-end 0))
2027 (cond 2028 (setq time
2028 ((equal name "// ") 2029 (format-time-string
2029 ;; FIXME: todo 2030 "%Y-%m-%d %H:%M"
2030 nil) 2031 (let ((high (truncate (/ time 65536))))
2031 ((equal name "/ ") 2032 (list high (truncate (- time (* 65536.0 high)))))))
2032 ;; FIXME: todo 2033 (setq extname
2033 nil) 2034 (cond ((equal name "// ")
2034 (t 2035 (propertize ".<ExtNamesTable>." 'face 'italic))
2035 (setq time 2036 ((equal name "/ ")
2036 (format-time-string 2037 (propertize ".<LookupTable>." 'face 'italic))
2037 "%Y-%m-%d %H:%M" 2038 ((string-match "/? *\\'" name)
2038 (let ((high (truncate (/ time 65536)))) 2039 (substring name 0 (match-beginning 0)))))
2039 (list high (truncate (- time (* 65536.0 high))))))) 2040 (setq user (substring user 0 (string-match " +\\'" user)))
2040 (setq name (substring name 0 (string-match "/? *\\'" name))) 2041 (setq group (substring group 0 (string-match " +\\'" group)))
2041 (setq user (substring user 0 (string-match " +\\'" user))) 2042 (setq mode (tar-grind-file-mode mode))
2042 (setq group (substring group 0 (string-match " +\\'" group))) 2043 ;; Move to the end of the data.
2043 (setq mode (tar-grind-file-mode mode)) 2044 (forward-char size) (if (eq ?\n (char-after)) (forward-char 1))
2044 ;; Move to the end of the data. 2045 (setq size (number-to-string size))
2045 (forward-char size) (if (eq ?\n (char-after)) (forward-char 1)) 2046 (if (> (length name) maxname) (setq maxname (length name)))
2046 (setq size (number-to-string size)) 2047 (if (> (length time) maxtime) (setq maxtime (length time)))
2047 (if (> (length name) maxname) (setq maxname (length name))) 2048 (if (> (length user) maxuser) (setq maxuser (length user)))
2048 (if (> (length time) maxtime) (setq maxtime (length time))) 2049 (if (> (length group) maxgroup) (setq maxgroup (length group)))
2049 (if (> (length user) maxuser) (setq maxuser (length user))) 2050 (if (> (length mode) maxmode) (setq maxmode (length mode)))
2050 (if (> (length group) maxgroup) (setq maxgroup (length group))) 2051 (if (> (length size) maxsize) (setq maxsize (length size)))
2051 (if (> (length mode) maxmode) (setq maxmode (length mode))) 2052 (push (vector name extname nil mode
2052 (if (> (length size) maxsize) (setq maxsize (length size))) 2053 time user group size)
2053 (push (vector name name nil mode 2054 files)))
2054 time user group size)
2055 files)))))
2056 (setq files (nreverse files)) 2055 (setq files (nreverse files))
2057 (goto-char (point-min)) 2056 (goto-char (point-min))
2058 (let* ((format (format "%%%ds %%%ds/%%-%ds %%%ds %%%ds %%s" 2057 (let* ((format (format "%%%ds %%%ds/%%-%ds %%%ds %%%ds %%s"
@@ -2091,25 +2090,25 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
2091 (save-restriction 2090 (save-restriction
2092 ;; We may be in archive-mode or not, so either with or without 2091 ;; We may be in archive-mode or not, so either with or without
2093 ;; narrowing and with or without a prepended summary. 2092 ;; narrowing and with or without a prepended summary.
2094 (widen) 2093 (save-excursion
2095 (search-forward "!<arch>\n") 2094 (widen)
2096 (while (and (not from) (looking-at archive-ar-file-header-re)) 2095 (search-forward "!<arch>\n")
2097 (let ((this (match-string 1))) 2096 (while (and (not from) (looking-at archive-ar-file-header-re))
2098 (setq size (string-to-number (match-string 6))) 2097 (let ((this (match-string 1)))
2099 (goto-char (match-end 0)) 2098 (setq size (string-to-number (match-string 6)))
2100 (setq this (substring this 0 (string-match "/? *\\'" this))) 2099 (goto-char (match-end 0))
2101 (if (equal name this) 2100 (if (equal name this)
2102 (setq from (point)) 2101 (setq from (point))
2103 ;; Move to the end of the data. 2102 ;; Move to the end of the data.
2104 (forward-char size) (if (eq ?\n (char-after)) (forward-char 1))))) 2103 (forward-char size) (if (eq ?\n (char-after)) (forward-char 1)))))
2105 (when from 2104 (when from
2106 (set-buffer-multibyte nil) 2105 (set-buffer-multibyte nil)
2107 (with-current-buffer destbuf 2106 (with-current-buffer destbuf
2108 ;; Do it within the `widen'. 2107 ;; Do it within the `widen'.
2109 (insert-buffer-substring archivebuf from (+ from size))) 2108 (insert-buffer-substring archivebuf from (+ from size)))
2110 (set-buffer-multibyte 'to) 2109 (set-buffer-multibyte 'to)
2111 ;; Inform the caller that the call succeeded. 2110 ;; Inform the caller that the call succeeded.
2112 t))))) 2111 t))))))
2113 2112
2114;; ------------------------------------------------------------------------- 2113;; -------------------------------------------------------------------------
2115;; This line was a mistake; it is kept now for compatibility. 2114;; This line was a mistake; it is kept now for compatibility.