aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-04 03:07:28 +0000
committerRichard M. Stallman1997-08-04 03:07:28 +0000
commite65db7b8cfd19b76026a690c3cd792d9b949642b (patch)
treeb6da21795768230491a6d541b347fa4e4a866e4f
parentebe4d555dcf8dac99947dd5a75ae50727964ccd3 (diff)
downloademacs-e65db7b8cfd19b76026a690c3cd792d9b949642b.tar.gz
emacs-e65db7b8cfd19b76026a690c3cd792d9b949642b.zip
(insert-file-contents-literally):
Bind coding-system-for-read and coding-system-for-write, and bind jka-compr-compression-info-list instead of file-name-handler-alist. (find-file-literally): Simplify and use insert-file-contents-literally.
-rw-r--r--lisp/files.el31
1 files changed, 10 insertions, 21 deletions
diff --git a/lisp/files.el b/lisp/files.el
index ad8aa5aee6d..e8c80354033 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -809,9 +809,11 @@ find-file-hooks, etc.
809 809
810This function does not work for remote files, because it turns off 810This function does not work for remote files, because it turns off
811file name handlers and remote file access uses a file name handler." 811file name handlers and remote file access uses a file name handler."
812 (let ((file-name-handler-alist nil) 812 (let ((format-alist nil)
813 (format-alist nil)
814 (after-insert-file-functions nil) 813 (after-insert-file-functions nil)
814 (coding-system-for-read 'no-conversion)
815 (coding-system-for-write 'no-conversion)
816 (jka-compr-compression-info-list nil)
815 (find-buffer-file-type-function 817 (find-buffer-file-type-function
816 (if (fboundp 'find-buffer-file-type) 818 (if (fboundp 'find-buffer-file-type)
817 (symbol-function 'find-buffer-file-type) 819 (symbol-function 'find-buffer-file-type)
@@ -830,7 +832,7 @@ If a buffer exists visiting FILENAME, return that one, but
830verify that the file has not changed since visited or saved. 832verify that the file has not changed since visited or saved.
831The buffer is not selected, just returned to the caller. 833The buffer is not selected, just returned to the caller.
832Optional first arg NOWARN non-nil means suppress any warning messages. 834Optional first arg NOWARN non-nil means suppress any warning messages.
833Optional second arg RAWFILE non-nil means the file is read literally" 835Optional second arg RAWFILE non-nil means the file is read literally."
834 (setq filename 836 (setq filename
835 (abbreviate-file-name 837 (abbreviate-file-name
836 (expand-file-name filename))) 838 (expand-file-name filename)))
@@ -950,26 +952,13 @@ Optional second arg RAWFILE non-nil means the file is read literally"
950 "Visit file FILENAME with no conversion of any kind. 952 "Visit file FILENAME with no conversion of any kind.
951Format conversion and character code conversion are both disabled, 953Format conversion and character code conversion are both disabled,
952and multibyte characters are disabled in the resulting buffer. 954and multibyte characters are disabled in the resulting buffer.
955The major mode used is Fundamental mode regardless of the file name,
956and local variable specifications in the file are ignored.
953Automatic uncompression is also disabled." 957Automatic uncompression is also disabled."
954 (interactive "FFind file literally: ") 958 (interactive "FFind file literally: ")
955 (let ((coding-system-for-read 'no-conversion) 959 (prog1
956 (coding-system-for-write 'no-conversion) 960 (switch-to-buffer (find-file-noselect filename nil t))
957 (auto-mode-alist (copy-sequence auto-mode-alist)) 961 (setq enable-multibyte-characters nil)))
958 (jka-compr-compression-info-list nil)
959 (format-alist nil)
960 (after-insert-file-functions nil)
961 tail)
962 ;; Turn off use of tar-mode and archive-mode
963 ;; for this one file. (We copied auto-mode-alist above
964 ;; so as not to alter it permanently.)
965 (setq tail auto-mode-alist)
966 (while tail
967 (if (memq (cdr (car tail)) '(tar-mode archive-mode))
968 (setq auto-mode-alist (delq (car tail) auto-mode-alist)))
969 (setq tail (cdr tail)))
970 (prog1
971 (find-file filename)
972 (setq enable-multibyte-characters nil))))
973 962
974(defvar after-find-file-from-revert-buffer nil) 963(defvar after-find-file-from-revert-buffer nil)
975 964