summaryrefslogtreecommitdiff
path: root/lisp/mh-e
diff options
context:
space:
mode:
authorStephen Gildea <stepheng+emacs@gildea.com>2020-01-04 15:28:07 -0800
committerStephen Gildea <stepheng+emacs@gildea.com>2020-01-04 15:30:53 -0800
commit7f01dfca5600fcd3e3548aee50734aab4b96b02f (patch)
treed8e99a92b830653697f17f4e0a4779f3c23f6c1d /lisp/mh-e
parentf95a2b83014a810d508448473b20186d55485efd (diff)
downloademacs-7f01dfca5600fcd3e3548aee50734aab4b96b02f.tar.gz
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.
Diffstat (limited to 'lisp/mh-e')
-rw-r--r--lisp/mh-e/mh-show.el14
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index 88710592831..952579fd3dd 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -221,6 +221,8 @@ Sets the current buffer to the show buffer."
;; pgp.el uses this.
(if (boundp 'write-contents-hooks) ;Emacs 19
(kill-local-variable 'write-contents-hooks))
+ (font-lock-mode -1)
+ (mh-show-mode)
(if formfile
(mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear"
(if (stringp formfile)
@@ -232,7 +234,6 @@ Sets the current buffer to the show buffer."
(mh-add-missing-mime-version-header)
(setf (mh-buffer-data) (mh-make-buffer-data))
(mh-mime-display))
- (mh-show-mode)
;; Header cleanup
(goto-char (point-min))
(cond (clean-message-header
@@ -252,13 +253,11 @@ Sets the current buffer to the show buffer."
(setq buffer-backed-up nil)
(auto-save-mode 1)
(set-mark nil)
- (unwind-protect
- (when (and mh-decode-mime-flag (not formfile))
- (setq buffer-read-only nil)
- (mh-display-smileys)
- (mh-display-emphasis))
- (setq buffer-read-only t))
+ (when (and mh-decode-mime-flag (not formfile))
+ (mh-display-smileys)
+ (mh-display-emphasis))
(set-buffer-modified-p nil)
+ (setq buffer-read-only t)
(setq mh-show-folder-buffer folder)
(setq mode-line-buffer-identification
(list (format mh-show-buffer-mode-line-buffer-id
@@ -870,7 +869,6 @@ See also `mh-folder-mode'.
(easy-menu-add mh-show-folder-menu)
(make-local-variable 'mh-show-folder-buffer)
(buffer-disable-undo)
- (setq buffer-read-only t)
(use-local-map mh-show-mode-map))