- (setq archive-subfile-dos nil)
- (if (boundp 'default-buffer-file-type)
- (setq buffer-file-type t))
- (if (fboundp extractor)
- (funcall extractor archive ename)
- (archive-*-extract archive ename (symbol-value extractor)))
- (if archive-dos-members (archive-check-dos))
- (goto-char (point-min))
- (rename-buffer bufname)
- (setq buffer-read-only read-only-p)
- (setq buffer-undo-list nil)
- (set-buffer-modified-p nil)
- (setq buffer-saved-size (buffer-size))
- (normal-mode)
- ;; Just in case an archive occurs inside another archive.
- (if (eq major-mode 'archive-mode)
- (setq archive-remote t))
- (run-hooks 'archive-extract-hooks))
+ (if (and
+ (null
+ (let (;; We may have to encode file name arguement for
+ ;; external programs.
+ (coding-system-for-write
+ (and enable-multibyte-characters
+ file-name-coding-system))
+ ;; We read an archive member by no-conversion at
+ ;; first, then decode appropriately by calling
+ ;; archive-set-buffer-as-visiting-file later.
+ (coding-system-for-read 'no-conversion))
+ (condition-case err
+ (if (fboundp extractor)
+ (funcall extractor archive ename)
+ (archive-*-extract archive ename
+ (symbol-value extractor)))
+ (error
+ (ding (message "%s" (error-message-string err)))
+ nil))))
+ just-created)
+ (progn
+ (set-buffer-modified-p nil)
+ (kill-buffer buffer))
+ (archive-set-buffer-as-visiting-file ename)
+ (goto-char (point-min))
+ (rename-buffer bufname)
+ (setq buffer-read-only read-only-p)
+ (setq buffer-undo-list nil)
+ (set-buffer-modified-p nil)
+ (setq buffer-saved-size (buffer-size))
+ (normal-mode)
+ ;; Just in case an archive occurs inside another archive.
+ (if (eq major-mode 'archive-mode)
+ (progn
+ (setq archive-remote t)
+ (if read-only-p (setq archive-read-only t))
+ ;; We will write out the archive ourselves if it is
+ ;; part of another archive.
+ (remove-hook 'write-contents-hooks 'archive-write-file t)))
+ (run-hooks 'archive-extract-hooks)
+ (if archive-read-only
+ (message "Note: altering this archive is not implemented."))))