diff options
author | Kenichi Handa <handa@m17n.org> | 2010-11-26 13:06:59 +0900 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2010-11-26 13:06:59 +0900 |
commit | d1be4ec2743387d7b8c0c5c83ca97fb345a0b4b2 (patch) | |
tree | 825910f5efd00c0518b6661081ee8d742eb7254a /lisp/mail/rmailsum.el | |
parent | e957f9ae90f3cab1584c06877cbff075d52a6a9a (diff) | |
download | emacs-d1be4ec2743387d7b8c0c5c83ca97fb345a0b4b2.tar.gz emacs-d1be4ec2743387d7b8c0c5c83ca97fb345a0b4b2.tar.bz2 emacs-d1be4ec2743387d7b8c0c5c83ca97fb345a0b4b2.zip |
Improve rmail's MIME handling.
Diffstat (limited to 'lisp/mail/rmailsum.el')
-rw-r--r-- | lisp/mail/rmailsum.el | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 80c65cdfb57..2d8019b6834 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -31,6 +31,7 @@ ;; For rmail-select-summary. (require 'rmail) +(require 'rfc2047) (defcustom rmail-summary-scroll-between-messages t "Non-nil means Rmail summary scroll commands move between messages. @@ -363,13 +364,15 @@ The current buffer contains the unrestricted message collection." (aset rmail-summary-vector (1- msgnum) line)) line)) -(defcustom rmail-summary-line-decoder (function identity) +(defcustom rmail-summary-line-decoder (function rfc2047-decode-string) "Function to decode a Rmail summary line. It receives the summary line for one message as a string and should return the decoded string. -By default, it is `identity', which returns the string unaltered." +By default, it is `rfc2047-decode-string', which decodes MIME-encoded +subject." :type 'function + :version "23.3" :group 'rmail-summary) (defun rmail-create-summary-line (msgnum) @@ -588,10 +591,17 @@ the message being processed." (t (- mch 14)))) (min len (+ lo 25))))))))) (concat (if (re-search-forward "^Subject:" nil t) - (progn (skip-chars-forward " \t") - (buffer-substring (point) - (progn (end-of-line) - (point)))) + (let (pos str) + (skip-chars-forward " \t") + (setq pos (point)) + (forward-line 1) + (setq str (buffer-substring pos (1- (point)))) + (while (looking-at "\\s ") + (setq str (concat str " " + (buffer-substring (match-end 0) + (line-end-position)))) + (forward-line 1)) + str) (re-search-forward "[\n][\n]+" nil t) (buffer-substring (point) (progn (end-of-line) (point)))) "\n"))) |