aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1997-07-08 09:57:37 +0000
committerRichard M. Stallman <[email protected]>1997-07-08 09:57:37 +0000
commit5fc196afb06ebcaef2475b5995f7b8717aadeeb2 (patch)
tree6b6f921990cb87425fd8026737c9d3f113adae68 /lisp
parent4e2aade12476c95329a65e32a3f85c6b5b3fea8f (diff)
(find-file-literally): New function.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/files.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el
index c794719964..d2557e4bee 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"
(after-find-file error (not nowarn))
(setq buf (current-buffer)))))
buf)))
+
+(defun find-file-literally (filename)
+ "Visit file FILENAME with no conversion of any kind.
+Format conversion and character code conversion are both disabled,
+and multibyte characters are disabled in the resulting buffer.
+Automatic uncompression is also disabled."
+ (interactive "FFind file literally: ")
+ (let ((coding-system-for-read 'no-conversion)
+ (coding-system-for-write 'no-conversion)
+ (jka-compr-compression-info-list nil)
+ (format-alist nil)
+ (after-insert-file-functions nil))
+ (prog1
+ (find-file filename)
+ (setq enable-multibyte-characters nil))))
(defvar after-find-file-from-revert-buffer nil)