diff options
| author | Richard M. Stallman | 1998-07-09 04:45:33 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-07-09 04:45:33 +0000 |
| commit | 1ed79e4156c16700b01dbed51f5cbdc53c72b4d4 (patch) | |
| tree | 373f16d29d90e02d15199520e19babfdc99407aa | |
| parent | 826bfb8b08ae740696cfd0c55fb40c6ee9a5d14b (diff) | |
| download | emacs-1ed79e4156c16700b01dbed51f5cbdc53c72b4d4.tar.gz emacs-1ed79e4156c16700b01dbed51f5cbdc53c72b4d4.zip | |
(rmail): If existing buffer, use local
enable-multibyte-characters for rmail-enable-multibyte.
(rmail-revert): Bind coding-system-for-read to raw-text,
then convert and make buffer multibyte, as in `rmail'.
| -rw-r--r-- | lisp/mail/rmail.el | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 078cb81a5fc..d7a25ea7059 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -488,7 +488,10 @@ If `rmail-display-summary' is non-nil, make a summary for this RMAIL file." | |||
| 488 | ;; This binding is necessary because we much decide if we | 488 | ;; This binding is necessary because we much decide if we |
| 489 | ;; need code conversion while the buffer is unibyte | 489 | ;; need code conversion while the buffer is unibyte |
| 490 | ;; (i.e. enable-multibyte-characters is nil). | 490 | ;; (i.e. enable-multibyte-characters is nil). |
| 491 | (rmail-enable-multibyte (default-value 'enable-multibyte-characters)) | 491 | (rmail-enable-multibyte |
| 492 | (if existed | ||
| 493 | (with-current-buffer existed enable-multibyte-characters) | ||
| 494 | (default-value 'enable-multibyte-characters))) | ||
| 492 | ;; Since the file may contain messages of different encodings | 495 | ;; Since the file may contain messages of different encodings |
| 493 | ;; at the tail (non-BYBYL part), we can't decode them at once | 496 | ;; at the tail (non-BYBYL part), we can't decode them at once |
| 494 | ;; on reading. So, at first, we read the file without text | 497 | ;; on reading. So, at first, we read the file without text |
| @@ -966,15 +969,27 @@ Instead, these commands are available: | |||
| 966 | 969 | ||
| 967 | ;; Handle M-x revert-buffer done in an rmail-mode buffer. | 970 | ;; Handle M-x revert-buffer done in an rmail-mode buffer. |
| 968 | (defun rmail-revert (arg noconfirm) | 971 | (defun rmail-revert (arg noconfirm) |
| 969 | (let ((revert-buffer-function (default-value 'revert-buffer-function))) | 972 | (let* ((revert-buffer-function (default-value 'revert-buffer-function)) |
| 973 | (rmail-enable-multibyte enable-multibyte-characters) | ||
| 974 | ;; See similar code in `rmail'. | ||
| 975 | (coding-system-for-read (and rmail-enable-multibyte 'raw-text))) | ||
| 970 | ;; Call our caller again, but this time it does the default thing. | 976 | ;; Call our caller again, but this time it does the default thing. |
| 971 | (if (revert-buffer arg noconfirm) | 977 | (if (revert-buffer arg noconfirm) |
| 972 | ;; If the user said "yes", and we changed something, | 978 | ;; If the user said "yes", and we changed something, |
| 973 | ;; reparse the messages. | 979 | ;; reparse the messages. |
| 974 | (progn | 980 | (progn |
| 981 | (rmail-mode-2) | ||
| 982 | ;; Convert all or part to Babyl file if possible. | ||
| 975 | (rmail-convert-file) | 983 | (rmail-convert-file) |
| 984 | ;; We have read the file as raw-text, so the buffer is set to | ||
| 985 | ;; unibyte. Make it multibyte if necessary. | ||
| 986 | (if (and rmail-enable-multibyte | ||
| 987 | (not enable-multibyte-characters)) | ||
| 988 | (set-buffer-multibyte t)) | ||
| 976 | (goto-char (point-max)) | 989 | (goto-char (point-max)) |
| 977 | (rmail-mode))))) | 990 | (rmail-set-message-counters) |
| 991 | (rmail-show-message rmail-total-messages) | ||
| 992 | (run-hooks 'rmail-mode-hook))))) | ||
| 978 | 993 | ||
| 979 | ;; Return a list of files from this buffer's Mail: option. | 994 | ;; Return a list of files from this buffer's Mail: option. |
| 980 | ;; Does not assume that messages have been parsed. | 995 | ;; Does not assume that messages have been parsed. |