From 780f583176ba3dba8e2fa0ba9eb8300b7e39f4bb Mon Sep 17 00:00:00 2001 From: morioka Date: Sat, 21 Mar 1998 17:54:32 +0000 Subject: [PATCH 1/1] (insert-file-contents-as-binary): Renamed from `insert-binary-file-contents'; add `insert-binary-file-contents' as obsolete alias. --- emu-e19.el | 21 +++++++++++++++------ emu-e20.el | 13 +++++++++++-- emu-mule.el | 28 ++++++++++++++++++---------- emu-nemacs.el | 17 ++++++++++------- emu-x20.el | 13 +++++++++++-- 5 files changed, 65 insertions(+), 27 deletions(-) diff --git a/emu-e19.el b/emu-e19.el index 8b11139..af1a841 100644 --- a/emu-e19.el +++ b/emu-e19.el @@ -159,6 +159,21 @@ else returns nil. [emu-e19.el; old MULE emulating function]" ;;; @ binary access ;;; +(defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. + +Namely this function ensures that only format decoding and character +code conversion will not take place." + (let ((emx-binary-mode t)) + (insert-file-contents filename visit beg end replace) + )) + +(defalias 'insert-binary-file-contents 'insert-file-contents-as-binary) +(make-obsolete 'insert-binary-file-contents 'insert-file-contents-as-binary) + (defun insert-binary-file-contents-literally (filename &optional visit beg end replace) "Like `insert-file-contents-literally', q.v., but don't code conversion. @@ -170,12 +185,6 @@ find-file-hooks, etc. (insert-file-contents-literally filename visit beg end replace) )) -(defun insert-binary-file-contents (filename &optional visit beg end replace) - "Like `insert-file-contents', q.v., but don't code and format conversion." - (let ((emx-binary-mode t)) - (insert-file-contents filename visit beg end replace) - )) - (defun write-region-as-binary (start end filename &optional append visit lockname) "Like `write-region', q.v., but don't code conversion." diff --git a/emu-e20.el b/emu-e20.el index 689f156..5eaafcf 100644 --- a/emu-e20.el +++ b/emu-e20.el @@ -75,8 +75,14 @@ in the region between START and END." ;;; @ binary access ;;; -(defun insert-binary-file-contents (filename &optional visit beg end replace) - "Like `insert-file-contents', q.v., but don't code and format conversion." +(defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. + +Namely this function ensures that only format decoding and character +code conversion will not take place." (let ((flag enable-multibyte-characters) (coding-system-for-read 'binary) format-alist) @@ -84,6 +90,9 @@ in the region between START and END." (setq enable-multibyte-characters flag) )) +(defalias 'insert-binary-file-contents 'insert-file-contents-as-binary) +(make-obsolete 'insert-binary-file-contents 'insert-file-contents-as-binary) + (defalias 'insert-binary-file-contents-literally 'insert-file-contents-literally) diff --git a/emu-mule.el b/emu-mule.el index 528232b..c726ab9 100644 --- a/emu-mule.el +++ b/emu-mule.el @@ -141,8 +141,24 @@ ;;; @ binary access ;;; -(defun insert-binary-file-contents-literally - (filename &optional visit beg end replace) +(defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. + +Namely this function ensures that only format decoding and character +code conversion will not take place." + (let (mc-flag + (file-coding-system *noconv*)) + (insert-file-contents filename visit beg end replace) + )) + +(defalias 'insert-binary-file-contents 'insert-file-contents-as-binary) +(make-obsolete 'insert-binary-file-contents 'insert-file-contents-as-binary) + +(defun insert-binary-file-contents-literally (filename + &optional visit beg end replace) "Like `insert-file-contents-literally', q.v., but don't code conversion. A buffer may be modified in several ways after reading into the buffer due to advanced Emacs features, such as file-name-handlers, format decoding, @@ -153,14 +169,6 @@ find-file-hooks, etc. (insert-file-contents-literally filename visit beg end replace) )) -(defun insert-binary-file-contents - (filename &optional visit beg end replace) - "Like `insert-file-contents', q.v., but don't code and format conversion." - (let (mc-flag - (file-coding-system *noconv*)) - (insert-file-contents filename visit beg end replace) - )) - (if running-emacs-19_29-or-later ;; for MULE 2.3 based on Emacs 19.34. (defun write-region-as-binary (start end filename diff --git a/emu-nemacs.el b/emu-nemacs.el index 21fdc61..0ded890 100644 --- a/emu-nemacs.el +++ b/emu-nemacs.el @@ -206,6 +206,16 @@ else returns nil. [emu-nemacs.el; Mule emulating function]" ;;; @ binary access ;;; +(defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't character code conversion. +\[emu-nemacs.el]" + (let (kanji-flag) + (insert-file-contents filename visit beg end replace) + )) + +(fset 'insert-binary-file-contents 'insert-file-contents-as-binary) + (defun insert-binary-file-contents-literally (filename &optional visit beg end replace) "Like `insert-file-contents-literally', q.v., but don't code conversion. @@ -218,13 +228,6 @@ find-file-hooks, etc. (insert-file-contents-literally filename visit beg end replace) )) -(defun insert-binary-file-contents (filename &optional visit beg end replace) - "Like `insert-file-contents', q.v., but don't code and format conversion. -\[emu-nemacs.el]" - (let (kanji-flag) - (insert-file-contents filename visit beg end replace) - )) - (defun write-region-as-binary (start end filename &optional append visit lockname) "Like `write-region', q.v., but don't code conversion. [emu-nemacs.el]" diff --git a/emu-x20.el b/emu-x20.el index 913eb3e..32a0618 100644 --- a/emu-x20.el +++ b/emu-x20.el @@ -39,13 +39,22 @@ ;;; @ binary access ;;; -(defun insert-binary-file-contents (filename &optional visit beg end replace) - "Like `insert-file-contents', q.v., but don't code and format conversion." +(defun insert-file-contents-as-binary (filename + &optional visit beg end replace) + "Like `insert-file-contents', q.v., but don't code and format conversion. +Like `insert-file-contents-literary', but it allows find-file-hooks, +automatic uncompression, etc. + +Namely this function ensures that only format decoding and character +code conversion will not take place." (let ((coding-system-for-read 'binary) format-alist) (insert-file-contents filename visit beg end replace) )) +(define-obsolete-function-alias 'insert-binary-file-contents + 'insert-file-contents-as-binary) + (defun insert-binary-file-contents-literally (filename &optional visit beg end replace) "Like `insert-file-contents-literally', q.v., but don't code conversion. -- 1.7.10.4