diff options
author | Eli Zaretskii <eliz@gnu.org> | 2001-09-16 07:56:36 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2001-09-16 07:56:36 +0000 |
commit | 1bbdda4d51e912915de4c5b220846c94f346d930 (patch) | |
tree | 49365f86ddfecf86bca29498e1dea4039ed34445 /lisp | |
parent | 966533c9c75383de8a8d0310fc0e1399d1a0b927 (diff) | |
download | emacs-1bbdda4d51e912915de4c5b220846c94f346d930.tar.gz |
(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>.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/ChangeLog | 8 | ||||
-rw-r--r-- | lisp/mail/rmail.el | 14 |
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 @@ +2001-09-16 Eli Zaretskii <eliz@is.elta.co.il> + + * mail/rmail.el (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>. + 2001-09-14 Eli Zaretskii <eliz@is.elta.co.il> * 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 @@ ;; (require 'mail-utils) +(eval-when-compile (require 'mule-util)) ; for detect-coding-with-priority ; These variables now declared in paths.el. ;(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." (rmail-require-mime-maybe) (let* ((file-name (expand-file-name (or file-name-arg rmail-file-name))) (existed (get-file-buffer file-name)) - ;; This binding is necessary because we much decide if we + ;; This binding is necessary because we must decide if we ;; need code conversion while the buffer is unibyte ;; (i.e. enable-multibyte-characters is nil). (rmail-enable-multibyte @@ -772,7 +773,16 @@ Note: it means the file has no messages in it.\n\^_"))) (setq to (point)) (unless (and coding-system (coding-system-p coding-system)) - (setq coding-system (detect-coding-region from to t))) + (setq coding-system + ;; Emacs 21.1 and later writes RMAIL files in emacs-mule, but + ;; earlier versions did that with the current buffer's encoding. + ;; So we want to favor detection of emacs-mule (whose normal + ;; priority is quite low), but still allow detection of other + ;; encodings if emacs-mule won't fit. The call to + ;; detect-coding-with-priority below achieves that. + (car (detect-coding-with-priority + from to + '((coding-category-emacs-mule . emacs-mule)))))) (unless (memq coding-system '(undecided undecided-unix)) (set-buffer-modified-p t) ; avoid locking when decoding |