diff options
| -rw-r--r-- | lisp/files.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el index c794719964c..d2557e4bee7 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -943,6 +943,21 @@ Optional second arg RAWFILE non-nil means the file is read literally" | |||
| 943 | (after-find-file error (not nowarn)) | 943 | (after-find-file error (not nowarn)) |
| 944 | (setq buf (current-buffer))))) | 944 | (setq buf (current-buffer))))) |
| 945 | buf))) | 945 | buf))) |
| 946 | |||
| 947 | (defun find-file-literally (filename) | ||
| 948 | "Visit file FILENAME with no conversion of any kind. | ||
| 949 | Format conversion and character code conversion are both disabled, | ||
| 950 | and multibyte characters are disabled in the resulting buffer. | ||
| 951 | Automatic uncompression is also disabled." | ||
| 952 | (interactive "FFind file literally: ") | ||
| 953 | (let ((coding-system-for-read 'no-conversion) | ||
| 954 | (coding-system-for-write 'no-conversion) | ||
| 955 | (jka-compr-compression-info-list nil) | ||
| 956 | (format-alist nil) | ||
| 957 | (after-insert-file-functions nil)) | ||
| 958 | (prog1 | ||
| 959 | (find-file filename) | ||
| 960 | (setq enable-multibyte-characters nil)))) | ||
| 946 | 961 | ||
| 947 | (defvar after-find-file-from-revert-buffer nil) | 962 | (defvar after-find-file-from-revert-buffer nil) |
| 948 | 963 | ||