From: ueno Date: Tue, 25 Sep 2001 04:41:38 +0000 (+0000) Subject: * mime-view.el (mime-view-insert-fontified-text-content): Don't use X-Git-Tag: emiko-1_14_1~10 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=de4ec97d1f570a28961107041a0aae9d3e5dac2d;p=elisp%2Fsemi.git * mime-view.el (mime-view-insert-fontified-text-content): Don't use `set-visited-filename'; set `buffer-file-name' temporarily. --- diff --git a/mime-view.el b/mime-view.el index c1ea11f..84734fb 100644 --- a/mime-view.el +++ b/mime-view.el @@ -923,21 +923,23 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." ;; on for buffers whose name begins with " ". That's why we use ;; save-current-buffer/get-buffer-create rather than ;; with-temp-buffer. - (let ((buffer (get-buffer-create "*fontification*")) + (let ((buffer (generate-new-buffer "*fontification*")) filename) - (save-current-buffer - (set-buffer buffer) - (buffer-disable-undo) - (kill-all-local-variables) - (erase-buffer) - (mime-view-insert-text-content entity situation) - (unwind-protect - (progn + (unwind-protect + (progn + (save-current-buffer + (set-buffer buffer) + (buffer-disable-undo) + (kill-all-local-variables) + (mime-view-insert-text-content entity situation) (if mode (funcall mode) (if (setq filename (mime-entity-filename entity)) - (set-visited-file-name filename)) - (set-auto-mode)) + (unwind-protect + (progn + (setq buffer-file-name filename) + (set-auto-mode)) + (setq buffer-file-name nil)))) (let ((font-lock-verbose nil)) ;; I find font-lock a bit too verbose. (font-lock-fontify-buffer)) @@ -949,8 +951,8 @@ MEDIA-TYPE must be (TYPE . SUBTYPE), TYPE or t. t means default." (set-extent-property ext 'duplicable t) nil) nil nil nil nil nil 'text-prop))) - (set-visited-file-name nil))) - (insert-buffer-substring buffer))) + (insert-buffer-substring buffer)) + (kill-buffer buffer)))) (defun mime-display-application/emacs-lisp (entity situation) (save-restriction