emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/mail/rmail.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/mail/rmail.el,v
Date: Fri, 01 Feb 2008 16:03:29 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     08/02/01 16:01:31

Index: lisp/mail/rmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/rmail.el,v
retrieving revision 1.446
retrieving revision 1.447
diff -u -b -r1.446 -r1.447
--- lisp/mail/rmail.el  1 Feb 2008 02:40:23 -0000       1.446
+++ lisp/mail/rmail.el  1 Feb 2008 16:01:27 -0000       1.447
@@ -945,17 +945,17 @@
     (unless (and coding-system
                 (coding-system-p coding-system))
       (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))
+           ;; If rmail-file-coding-system is nil, Emacs 21 writes
+           ;; RMAIL files in emacs-mule, Emacs 22 in utf-8, 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) and utf-8, but
+           ;; still allow detection of other encodings if they won't
+           ;; fit.  The call to with-coding-priority below achieves
+           ;; that.
+           (with-coding-priority '(emacs-mule utf-8)
+             (detect-coding-region from to 'highest))))
+    (unless (eq (coding-system-type coding-system) 'undecided)
       (set-buffer-modified-p t)                ; avoid locking when decoding
       (let ((buffer-undo-list t))
        (decode-coding-region from to coding-system))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]