X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/fb3aad6604e651b37ae28d010b78678f4de389ee..24deb97dd68cd102ba6698b2bd1d5a3dd70998ec:/lisp/arc-mode.el diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 335248d992..83ffe65c97 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -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 . ;;; 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)