diff options
| author | Stephen Gildea | 2020-01-04 15:28:07 -0800 |
|---|---|---|
| committer | Stephen Gildea | 2020-01-04 15:30:53 -0800 |
| commit | 7f01dfca5600fcd3e3548aee50734aab4b96b02f (patch) | |
| tree | d8e99a92b830653697f17f4e0a4779f3c23f6c1d | |
| parent | f95a2b83014a810d508448473b20186d55485efd (diff) | |
| download | emacs-7f01dfca5600fcd3e3548aee50734aab4b96b02f.tar.gz emacs-7f01dfca5600fcd3e3548aee50734aab4b96b02f.zip | |
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.
| -rw-r--r-- | lisp/mh-e/mh-show.el | 14 |
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." | |||
| 221 | ;; pgp.el uses this. | 221 | ;; pgp.el uses this. |
| 222 | (if (boundp 'write-contents-hooks) ;Emacs 19 | 222 | (if (boundp 'write-contents-hooks) ;Emacs 19 |
| 223 | (kill-local-variable 'write-contents-hooks)) | 223 | (kill-local-variable 'write-contents-hooks)) |
| 224 | (font-lock-mode -1) | ||
| 225 | (mh-show-mode) | ||
| 224 | (if formfile | 226 | (if formfile |
| 225 | (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear" | 227 | (mh-exec-lib-cmd-output "mhl" "-nobell" "-noclear" |
| 226 | (if (stringp formfile) | 228 | (if (stringp formfile) |
| @@ -232,7 +234,6 @@ Sets the current buffer to the show buffer." | |||
| 232 | (mh-add-missing-mime-version-header) | 234 | (mh-add-missing-mime-version-header) |
| 233 | (setf (mh-buffer-data) (mh-make-buffer-data)) | 235 | (setf (mh-buffer-data) (mh-make-buffer-data)) |
| 234 | (mh-mime-display)) | 236 | (mh-mime-display)) |
| 235 | (mh-show-mode) | ||
| 236 | ;; Header cleanup | 237 | ;; Header cleanup |
| 237 | (goto-char (point-min)) | 238 | (goto-char (point-min)) |
| 238 | (cond (clean-message-header | 239 | (cond (clean-message-header |
| @@ -252,13 +253,11 @@ Sets the current buffer to the show buffer." | |||
| 252 | (setq buffer-backed-up nil) | 253 | (setq buffer-backed-up nil) |
| 253 | (auto-save-mode 1) | 254 | (auto-save-mode 1) |
| 254 | (set-mark nil) | 255 | (set-mark nil) |
| 255 | (unwind-protect | 256 | (when (and mh-decode-mime-flag (not formfile)) |
| 256 | (when (and mh-decode-mime-flag (not formfile)) | 257 | (mh-display-smileys) |
| 257 | (setq buffer-read-only nil) | 258 | (mh-display-emphasis)) |
| 258 | (mh-display-smileys) | ||
| 259 | (mh-display-emphasis)) | ||
| 260 | (setq buffer-read-only t)) | ||
| 261 | (set-buffer-modified-p nil) | 259 | (set-buffer-modified-p nil) |
| 260 | (setq buffer-read-only t) | ||
| 262 | (setq mh-show-folder-buffer folder) | 261 | (setq mh-show-folder-buffer folder) |
| 263 | (setq mode-line-buffer-identification | 262 | (setq mode-line-buffer-identification |
| 264 | (list (format mh-show-buffer-mode-line-buffer-id | 263 | (list (format mh-show-buffer-mode-line-buffer-id |
| @@ -870,7 +869,6 @@ See also `mh-folder-mode'. | |||
| 870 | (easy-menu-add mh-show-folder-menu) | 869 | (easy-menu-add mh-show-folder-menu) |
| 871 | (make-local-variable 'mh-show-folder-buffer) | 870 | (make-local-variable 'mh-show-folder-buffer) |
| 872 | (buffer-disable-undo) | 871 | (buffer-disable-undo) |
| 873 | (setq buffer-read-only t) | ||
| 874 | (use-local-map mh-show-mode-map)) | 872 | (use-local-map mh-show-mode-map)) |
| 875 | 873 | ||
| 876 | 874 | ||