;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
;; Author: firstname.lastname@example.org (Jay K. Adams)
;; This file is part of XEmacs.
(defun jka-compr-insert-file-contents (file &optional visit beg end replace)
+ "Insert contents of FILE in current buffer after point.
+Returns list of absolute file name and length of data inserted.
+If second argument VISIT is non-nil, the buffer's visited filename
+and last save file modtime are set, and it is marked unmodified.
+If visiting and the file does not exist, visiting is completed
+before the error is signaled.
+The optional third and fourth arguments BEG and END
+specify what portion of the file to insert.
+If VISIT is non-nil, BEG and END must be nil.
+If optional fifth argument REPLACE is non-nil,
+it means replace the current buffer contents (in the accessible portion)
+with the file contents. This is better than simply deleting and inserting
+the whole thing because (1) it preserves some marker positions
+and (2) it puts less data in the undo list. (#### Is (2) true?)
+Coding system determination differs from `insert-file-contents'. It is set
+to 'undecided unless `coding-system-for-read' is bound. WARNING: That means
+this function is likely broken under Mule. Use jka-compr at your own risk
(setq size (- (point) start))
- (let* ((del-beg (point))
- (del-end (+ del-beg size)))
- (min del-end (point-max)))))
+ (delete-region (point) (point-max)))
(if (and (eq (car error-code) 'file-error)