(Vauto_save_list_file_name): Move here from file.el.
[bpt/emacs.git] / lisp / arc-mode.el
index 335248d..ddbedeb 100644 (file)
@@ -9,10 +9,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,9 +20,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -232,7 +230,7 @@ be added."
                        (string :format "%v")))
   :group 'archive-zip)
 
-;; For several reasons the latter behaviour is not desirable in general.
+;; For several reasons the latter behavior is not desirable in general.
 ;; (1) It uses more disk space.  (2) Error checking is worse or non-
 ;; existent.  (3) It tends to do funny things with other systems' file
 ;; names.
@@ -725,7 +723,7 @@ archive.
                (string-match "\\.[aA][rR][cC]$"
                              (or buffer-file-name (buffer-name))))
           'arc)
-          ;; This pattern modelled on the BSD/GNU+Linux `file' command.
+          ;; This pattern modeled on the BSD/GNU+Linux `file' command.
           ;; Have seen capital "LHA's", and file has lower case "LHa's" too.
           ;; Note this regexp is also in archive-exe-p.
           ((looking-at "MZ\\(.\\|\n\\)\\{34\\}LH[aA]'s SFX ") 'lzh-exe)
@@ -1061,7 +1059,7 @@ using `make-temp-file', and the generated name is returned."
                 nil
                 nil
                 (append (cdr command) (list archive name))))
-    (cond ((and (numberp exit-status) (= exit-status 0))
+    (cond ((and (numberp exit-status) (zerop exit-status))
           (if (not (file-exists-p tmpfile))
               (ding (message "`%s': no such file or directory" tmpfile))
             (insert-file-contents tmpfile)
@@ -1119,7 +1117,7 @@ using `make-temp-file', and the generated name is returned."
                          (file-name-nondirectory buffer-file-name)
                        ""))))
   (with-current-buffer arcbuf
-    (or (eq major-mode 'archive-mode)
+    (or (derived-mode-p 'archive-mode)
        (error "Buffer is not an archive buffer"))
     (if archive-read-only
        (error "Archive is read-only")))
@@ -1173,7 +1171,7 @@ using `make-temp-file', and the generated name is returned."
          ;; the dired-like listing we created.
          (if (eq major-mode 'archive-mode)
              (archive-write-file tmpfile)
-           (write-region (point-min) (point-max) tmpfile nil 'nomessage))
+           (write-region nil nil tmpfile nil 'nomessage))
          ;; basic-save-buffer needs last-coding-system-used to have
          ;; the value used to write the file, so save it before any
          ;; further processing clobbers it (we restore it in
@@ -1192,9 +1190,8 @@ using `make-temp-file', and the generated name is returned."
                                  nil
                                  (append (cdr command)
                                          (list archive ename)))))
-            (if (equal exitcode 0)
-                nil
-              (error "Updating was unsuccessful (%S)" exitcode))))
+            (or (zerop exitcode)
+               (error "Updating was unsuccessful (%S)" exitcode))))
       (archive-delete-local tmpfile))))
 
 (defun archive-write-file (&optional file)
@@ -1734,7 +1731,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
                         str archive-file-name-coding-system)))
             (isdir   (and (= ucsize 0)
                           (string= (file-name-nondirectory efnname) "")))
-            (mode    (cond ((memq creator '(2 3)) ; Unix + VMS
+            (mode    (cond ((memq creator '(2 3)) ; Unix
                             (archive-l-e (+ p 40) 2))
                            ((memq creator '(0 5 6 7 10 11 15)) ; Dos etc.
                             (logior ?\444
@@ -1803,7 +1800,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
               (oldmode (aref fil 3))
               (newval  (archive-calc-mode oldmode newmode t))
               (inhibit-read-only t))
-         (cond ((memq creator '(2 3)) ; Unix + VMS
+         (cond ((memq creator '(2 3)) ; Unix
                 (goto-char (+ p 40))
                 (delete-char 2)
                 (insert-unibyte (logand newval 255) (lsh newval -8)))