]> code.delx.au - gnu-emacs/blobdiff - lisp/arc-mode.el
Merge from emacs-24; up to 2012-12-29T12:57:49Z!fgallina@gnu.org
[gnu-emacs] / lisp / arc-mode.el
index a97a052dc08fae676cee77b277c91673588a458e..5f001ad977b43f177030e8d9c0904c9811236d55 100644 (file)
@@ -1,6 +1,7 @@
 ;;; arc-mode.el --- simple editing of archives
 
-;; Copyright (C) 1995, 1997-1998, 2001-2012  Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997-1998, 2001-2013 Free Software Foundation,
+;; Inc.
 
 ;; Author: Morten Welinder <terra@gnu.org>
 ;; Keywords: files archives msdog editing major-mode
@@ -96,7 +97,7 @@
 ;;
 ;; archive-mode-hook
 ;; archive-foo-mode-hook
-;; archive-extract-hooks
+;; archive-extract-hook
 
 ;;; Code:
 
@@ -140,8 +141,10 @@ A local copy of the archive will be used when updating."
   :type 'regexp
   :group 'archive)
 
-(defcustom archive-extract-hooks nil
-  "Hooks to run when an archive member has been extracted."
+(define-obsolete-variable-alias 'archive-extract-hooks
+  'archive-extract-hook "24.3")
+(defcustom archive-extract-hook nil
+  "Hook run when an archive member has been extracted."
   :type 'hook
   :group 'archive)
 ;; ------------------------------
@@ -686,9 +689,7 @@ archive.
        (setq revert-buffer-function 'archive-mode-revert)
        (auto-save-mode 0)
 
-       ;; Remote archives are not written by a hook.
-       (if archive-remote nil
-         (add-hook 'write-contents-functions 'archive-write-file nil t))
+       (add-hook 'write-contents-functions 'archive-write-file nil t)
 
        (make-local-variable 'require-final-newline)
        (setq require-final-newline nil)
@@ -787,7 +788,8 @@ is visible (and the real data of the buffer is hidden).
 Optional argument SHUT-UP, if non-nil, means don't print messages
 when parsing the archive."
   (widen)
-  (let ((inhibit-read-only t))
+  (let ((buffer-file-truename nil) ; avoid changing dir mtime by lock_file
+       (inhibit-read-only t))
     (setq archive-proper-file-start (copy-marker (point-min) t))
     (set (make-local-variable 'change-major-mode-hook) 'archive-desummarize)
     (or shut-up
@@ -971,11 +973,6 @@ using `make-temp-file', and the generated name is returned."
                    (save-excursion
                      (funcall set-auto-coding-function
                               filename (- (point-max) (point-min)))))
-              ;; dos-w32.el defines the function
-              ;; find-buffer-file-type-coding-system for DOS/Windows
-              ;; systems which preserves the coding-system of existing files.
-              ;; (That function is called via file-coding-system-alist.)
-              ;; Here, we want it to act as if the extracted file existed.
               ;; The following let-binding of file-name-handler-alist forces
               ;; find-file-not-found-set-buffer-file-coding-system to ignore
               ;; the file's name (see dos-w32.el).
@@ -1077,7 +1074,7 @@ using `make-temp-file', and the generated name is returned."
               ;; We will write out the archive ourselves if it is
               ;; part of another archive.
               (remove-hook 'write-contents-functions 'archive-write-file t))
-            (run-hooks 'archive-extract-hooks)
+            (run-hooks 'archive-extract-hook)
            (if archive-read-only
                (message "Note: altering this archive is not implemented."))))
        (archive-maybe-update t))