Show
Ignore:
Timestamp:
06/02/07 09:29:41 (1 year ago)
Author:
miyoshi
Message:

Sync up with Emacs_22_BASE.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/tar-mode.el

    r4190 r4210  
    682682  (tar-extract)) 
    683683 
     684(defun tar-file-name-handler (op &rest args) 
     685  "Helper function for `tar-extract'." 
     686  (or (eq op 'file-exists-p) 
     687      (let ((file-name-handler-alist nil)) 
     688        (apply op args)))) 
     689 
    684690(defun tar-extract (&optional other-window-p) 
    685691  "In Tar mode, extract this entry of the tar file into its own buffer." 
     
    736742                                    (funcall set-auto-coding-function 
    737743                                             name (- (point-max) (point))))) 
    738                              (car (find-operation-coding-system 
    739                                    'insert-file-contents 
    740                                    (cons name (current-buffer)) t)))) 
     744                             ;; The following binding causes 
     745                             ;; find-buffer-file-type-coding-system 
     746                             ;; (defined on dos-w32.el) to act as if 
     747                             ;; the file being extracted existed, so 
     748                             ;; that the file's contents' encoding and 
     749                             ;; EOL format are auto-detected. 
     750                             (let ((file-name-handler-alist 
     751                                    (if (featurep 'dos-w32) 
     752                                        '(("" . tar-file-name-handler)) 
     753                                      file-name-handler-alist))) 
     754                               (car (find-operation-coding-system 
     755                                     'insert-file-contents 
     756                                     (cons name (current-buffer)) t))))) 
    741757                        (multibyte enable-multibyte-characters) 
    742758                        (detected (detect-coding-region 
     
    759775                               coding 'raw-text))) 
    760776                    (decode-coding-region (point-min) (point-max) coding) 
    761                     (set-buffer-file-coding-system coding)) 
     777                    ;; Force buffer-file-coding-system to what 
     778                    ;; decode-coding-region actually used. 
     779                    (set-buffer-file-coding-system last-coding-system-used t)) 
    762780                  ;; Set the default-directory to the dir of the 
    763781                  ;; superior buffer.