From: yamaoka Date: Wed, 9 Dec 1998 09:19:39 +0000 (+0000) Subject: (find-file-noselect-as-raw-text): Convert line-break code each time. X-Git-Tag: apel-199812091900~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=e3c23cdd1fc0702d3523ab658f6cf6cd9c411f70;p=elisp%2Fapel.git (find-file-noselect-as-raw-text): Convert line-break code each time. --- 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."