From e3c23cdd1fc0702d3523ab658f6cf6cd9c411f70 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 9 Dec 1998 09:19:39 +0000 Subject: [PATCH] (find-file-noselect-as-raw-text): Convert line-break code each time. --- poem-om.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/poem-om.el b/poem-om.el index 45422b5..2b64f96 100644 --- a/poem-om.el +++ b/poem-om.el @@ -231,15 +231,15 @@ find-file-hooks, etc. (defun find-file-noselect-as-raw-text (filename &optional nowarn rawfile) "Like `find-file-noselect', q.v., but it does not code and format conversion except for line-break code." - (let ((buffer (get-file-buffer filename))) - (save-current-buffer - (prog1 - (set-buffer (find-file-noselect-as-binary filename nowarn rawfile)) - (unless buffer - (while (re-search-forward "\r$" nil t) - (replace-match "")) + (save-current-buffer + (prog1 + (set-buffer (find-file-noselect-as-binary filename nowarn rawfile)) + (let ((flag (buffer-modified-p))) + (save-excursion (goto-char (point-min)) - (set-buffer-modified-p nil)))))) + (while (re-search-forward "\r$" nil t) + (replace-match ""))) + (set-buffer-modified-p flag))))) (defun open-network-stream-as-binary (name buffer host service) "Like `open-network-stream', q.v., but don't code conversion." -- 1.7.10.4