aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2003-05-07 21:58:24 +0000
committerJuanma Barranquero2003-05-07 21:58:24 +0000
commitcdec2ad721e1836c020cdb3dfb3f5be1bf0dead5 (patch)
tree6009245e7caea14d734067710e280f79968c2766
parentad599c11938b8cf5ccc85c403fb4659debac5d33 (diff)
downloademacs-cdec2ad721e1836c020cdb3dfb3f5be1bf0dead5.tar.gz
emacs-cdec2ad721e1836c020cdb3dfb3f5be1bf0dead5.zip
(insert-file-contents-literally): Allow it to be called within a magic file name
handler.
-rw-r--r--lisp/files.el20
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/files.el b/lisp/files.el
index cd94fc7cd8c..b7553f1a886 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -803,7 +803,7 @@ use with M-x."
803 default-coding)) 803 default-coding))
804 (setq from-coding (read-coding-system 804 (setq from-coding (read-coding-system
805 (format "Recode filename %s from: " filename)))) 805 (format "Recode filename %s from: " filename))))
806 806
807 ;; We provide the default coding only when a user is going to 807 ;; We provide the default coding only when a user is going to
808 ;; change the encoding not from the default coding. 808 ;; change the encoding not from the default coding.
809 (if (eq from-coding default-coding) 809 (if (eq from-coding default-coding)
@@ -1412,15 +1412,17 @@ This function ensures that none of these modifications will take place."
1412 (coding-system-for-read 'no-conversion) 1412 (coding-system-for-read 'no-conversion)
1413 (coding-system-for-write 'no-conversion) 1413 (coding-system-for-write 'no-conversion)
1414 (find-buffer-file-type-function 1414 (find-buffer-file-type-function
1415 (if (fboundp 'find-buffer-file-type) 1415 (if (fboundp 'find-buffer-file-type)
1416 (symbol-function 'find-buffer-file-type) 1416 (symbol-function 'find-buffer-file-type)
1417 nil)) 1417 nil))
1418 (inhibit-file-name-handlers '(jka-compr-handler image-file-handler)) 1418 (inhibit-file-name-handlers
1419 (inhibit-file-name-operation 'insert-file-contents)) 1419 (append '(jka-compr-handler image-file-handler)
1420 inhibit-file-name-handlers))
1421 (inhibit-file-name-operation 'insert-file-contents))
1420 (unwind-protect 1422 (unwind-protect
1421 (progn 1423 (progn
1422 (fset 'find-buffer-file-type (lambda (filename) t)) 1424 (fset 'find-buffer-file-type (lambda (filename) t))
1423 (insert-file-contents filename visit beg end replace)) 1425 (insert-file-contents filename visit beg end replace))
1424 (if find-buffer-file-type-function 1426 (if find-buffer-file-type-function
1425 (fset 'find-buffer-file-type find-buffer-file-type-function) 1427 (fset 'find-buffer-file-type find-buffer-file-type-function)
1426 (fmakunbound 'find-buffer-file-type))))) 1428 (fmakunbound 'find-buffer-file-type)))))