Skip to content

Commit 7f01dfc

Browse files
author
Stephen Gildea
committed
Fix MH-E bug #470: Show buffer discards text properties
* lisp/mh-e/mh-show.el (mh-display-msg): reset font lock and set major mode *before* formatting message content. This changes lets fonts work when the Show buffer is reused for a new message. (mh-show-mode): no longer set buffer-read-only; that is better done by mh-display-msg after setting all content.
1 parent f95a2b8 commit 7f01dfc

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lisp/mh-e/mh-show.el

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ Sets the current buffer to the show buffer."
221221
;; pgp.el uses this.
222222
(if (boundp 'write-contents-hooks) ;Emacs 19
223223
(kill-local-variable 'write-contents-hooks))
224+
(font-lock-mode -1)
225+
(mh-show-mode)
224226
(if formfile
225227
(mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear"
226228
(if (stringp formfile)
@@ -232,7 +234,6 @@ Sets the current buffer to the show buffer."
232234
(mh-add-missing-mime-version-header)
233235
(setf (mh-buffer-data) (mh-make-buffer-data))
234236
(mh-mime-display))
235-
(mh-show-mode)
236237
;; Header cleanup
237238
(goto-char (point-min))
238239
(cond (clean-message-header
@@ -252,13 +253,11 @@ Sets the current buffer to the show buffer."
252253
(setq buffer-backed-up nil)
253254
(auto-save-mode 1)
254255
(set-mark nil)
255-
(unwind-protect
256-
(when (and mh-decode-mime-flag (not formfile))
257-
(setq buffer-read-only nil)
258-
(mh-display-smileys)
259-
(mh-display-emphasis))
260-
(setq buffer-read-only t))
256+
(when (and mh-decode-mime-flag (not formfile))
257+
(mh-display-smileys)
258+
(mh-display-emphasis))
261259
(set-buffer-modified-p nil)
260+
(setq buffer-read-only t)
262261
(setq mh-show-folder-buffer folder)
263262
(setq mode-line-buffer-identification
264263
(list (format mh-show-buffer-mode-line-buffer-id
@@ -870,7 +869,6 @@ See also `mh-folder-mode'.
870869
(easy-menu-add mh-show-folder-menu)
871870
(make-local-variable 'mh-show-folder-buffer)
872871
(buffer-disable-undo)
873-
(setq buffer-read-only t)
874872
(use-local-map mh-show-mode-map))
875873

876874

0 commit comments

Comments
 (0)