diff options
| author | Richard M. Stallman | 1997-08-04 03:07:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-04 03:07:28 +0000 |
| commit | e65db7b8cfd19b76026a690c3cd792d9b949642b (patch) | |
| tree | b6da21795768230491a6d541b347fa4e4a866e4f | |
| parent | ebe4d555dcf8dac99947dd5a75ae50727964ccd3 (diff) | |
| download | emacs-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.el | 31 |
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 | ||
| 810 | This function does not work for remote files, because it turns off | 810 | This function does not work for remote files, because it turns off |
| 811 | file name handlers and remote file access uses a file name handler." | 811 | file 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 | |||
| 830 | verify that the file has not changed since visited or saved. | 832 | verify that the file has not changed since visited or saved. |
| 831 | The buffer is not selected, just returned to the caller. | 833 | The buffer is not selected, just returned to the caller. |
| 832 | Optional first arg NOWARN non-nil means suppress any warning messages. | 834 | Optional first arg NOWARN non-nil means suppress any warning messages. |
| 833 | Optional second arg RAWFILE non-nil means the file is read literally" | 835 | Optional 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. |
| 951 | Format conversion and character code conversion are both disabled, | 953 | Format conversion and character code conversion are both disabled, |
| 952 | and multibyte characters are disabled in the resulting buffer. | 954 | and multibyte characters are disabled in the resulting buffer. |
| 955 | The major mode used is Fundamental mode regardless of the file name, | ||
| 956 | and local variable specifications in the file are ignored. | ||
| 953 | Automatic uncompression is also disabled." | 957 | Automatic 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 | ||