aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2001-09-16 07:56:36 +0000
committerEli Zaretskii2001-09-16 07:56:36 +0000
commit1bbdda4d51e912915de4c5b220846c94f346d930 (patch)
tree49365f86ddfecf86bca29498e1dea4039ed34445
parent966533c9c75383de8a8d0310fc0e1399d1a0b927 (diff)
downloademacs-1bbdda4d51e912915de4c5b220846c94f346d930.tar.gz
emacs-1bbdda4d51e912915de4c5b220846c94f346d930.zip
(top-level): Require mule-utils when compiling.
(rmail-decode-babyl-format): Use detect-coding-with-priority instead of detect-coding-region, to favor detection of emacs-mule encoded Babyl files written by rmailout.el etc. Suggested by Kenichi Handa <handa@etl.go.jp>.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/mail/rmail.el14
2 files changed, 20 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6fdfa213631..42f897fb98f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12001-09-16 Eli Zaretskii <eliz@is.elta.co.il>
2
3 * mail/rmail.el (top-level): Require mule-utils when compiling.
4 (rmail-decode-babyl-format): Use detect-coding-with-priority
5 instead of detect-coding-region, to favor detection of emacs-mule
6 encoded Babyl files written by rmailout.el etc. Suggested by
7 Kenichi Handa <handa@etl.go.jp>.
8
12001-09-14 Eli Zaretskii <eliz@is.elta.co.il> 92001-09-14 Eli Zaretskii <eliz@is.elta.co.il>
2 10
3 * eshell/em-unix.el (eshell-shuffle-files, eshell-shuffle-files): 11 * eshell/em-unix.el (eshell-shuffle-files, eshell-shuffle-files):
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index e35932f64df..00626ffc3af 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -40,6 +40,7 @@
40;; 40;;
41 41
42(require 'mail-utils) 42(require 'mail-utils)
43(eval-when-compile (require 'mule-util)) ; for detect-coding-with-priority
43 44
44; These variables now declared in paths.el. 45; These variables now declared in paths.el.
45;(defvar rmail-spool-directory "/usr/spool/mail/" 46;(defvar rmail-spool-directory "/usr/spool/mail/"
@@ -621,7 +622,7 @@ If `rmail-display-summary' is non-nil, make a summary for this RMAIL file."
621 (rmail-require-mime-maybe) 622 (rmail-require-mime-maybe)
622 (let* ((file-name (expand-file-name (or file-name-arg rmail-file-name))) 623 (let* ((file-name (expand-file-name (or file-name-arg rmail-file-name)))
623 (existed (get-file-buffer file-name)) 624 (existed (get-file-buffer file-name))
624 ;; This binding is necessary because we much decide if we 625 ;; This binding is necessary because we must decide if we
625 ;; need code conversion while the buffer is unibyte 626 ;; need code conversion while the buffer is unibyte
626 ;; (i.e. enable-multibyte-characters is nil). 627 ;; (i.e. enable-multibyte-characters is nil).
627 (rmail-enable-multibyte 628 (rmail-enable-multibyte
@@ -772,7 +773,16 @@ Note: it means the file has no messages in it.\n\^_")))
772 (setq to (point)) 773 (setq to (point))
773 (unless (and coding-system 774 (unless (and coding-system
774 (coding-system-p coding-system)) 775 (coding-system-p coding-system))
775 (setq coding-system (detect-coding-region from to t))) 776 (setq coding-system
777 ;; Emacs 21.1 and later writes RMAIL files in emacs-mule, but
778 ;; earlier versions did that with the current buffer's encoding.
779 ;; So we want to favor detection of emacs-mule (whose normal
780 ;; priority is quite low), but still allow detection of other
781 ;; encodings if emacs-mule won't fit. The call to
782 ;; detect-coding-with-priority below achieves that.
783 (car (detect-coding-with-priority
784 from to
785 '((coding-category-emacs-mule . emacs-mule))))))
776 (unless (memq coding-system 786 (unless (memq coding-system
777 '(undecided undecided-unix)) 787 '(undecided undecided-unix))
778 (set-buffer-modified-p t) ; avoid locking when decoding 788 (set-buffer-modified-p t) ; avoid locking when decoding