summaryrefslogtreecommitdiff
path: root/lisp/mail
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-01-17 11:01:01 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2011-01-17 11:01:01 -0800
commita3e44e793796153ff1534be9c74fcab50b45de30 (patch)
tree863d5db087c8e034c96d06ea955515f4d3f3d0a3 /lisp/mail
parent7f818df9420a1320539f7e3e633003573a570413 (diff)
parent721be9cd4865e9f7d68020adcfa672d2edd52b07 (diff)
downloademacs-a3e44e793796153ff1534be9c74fcab50b45de30.tar.gz
Merge from mainline.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/blessmail.el1
-rw-r--r--lisp/mail/feedmail.el1
-rw-r--r--lisp/mail/footnote.el1
-rw-r--r--lisp/mail/hashcash.el3
-rw-r--r--lisp/mail/mail-extr.el3
-rw-r--r--lisp/mail/mail-hist.el1
-rw-r--r--lisp/mail/mailabbrev.el1
-rw-r--r--lisp/mail/mailalias.el5
-rw-r--r--lisp/mail/mailclient.el1
-rw-r--r--lisp/mail/mailheader.el4
-rw-r--r--lisp/mail/mailpost.el1
-rw-r--r--lisp/mail/metamail.el1
-rw-r--r--lisp/mail/mspools.el4
-rw-r--r--lisp/mail/reporter.el1
-rw-r--r--lisp/mail/rfc822.el1
-rw-r--r--lisp/mail/rmail-spam-filter.el1
-rw-r--r--lisp/mail/rmail.el14
-rw-r--r--lisp/mail/rmailedit.el1
-rw-r--r--lisp/mail/rmailkwd.el1
-rw-r--r--lisp/mail/rmailmm.el280
-rw-r--r--lisp/mail/rmailmsc.el1
-rw-r--r--lisp/mail/rmailout.el1
-rw-r--r--lisp/mail/rmailsort.el1
-rw-r--r--lisp/mail/rmailsum.el1
-rw-r--r--lisp/mail/supercite.el1
-rw-r--r--lisp/mail/uce.el1
-rw-r--r--lisp/mail/undigest.el1
-rw-r--r--lisp/mail/unrmail.el1
28 files changed, 180 insertions, 154 deletions
diff --git a/lisp/mail/blessmail.el b/lisp/mail/blessmail.el
index 4737f86a6ad..297bf86d5cf 100644
--- a/lisp/mail/blessmail.el
+++ b/lisp/mail/blessmail.el
@@ -66,5 +66,4 @@
(write-region (point-min) (point-max) "blessmail")
(kill-emacs)
-;; arch-tag: c3329fe2-f945-41a9-8b00-b4b038ff182f
;;; blessmail.el ends here
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index 5c6da623fed..597344fb88a 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -2662,5 +2662,4 @@ been weeded out."
(provide 'feedmail)
-;; arch-tag: ec27b380-11c0-4dfd-8436-f636cf2bb992
;;; feedmail.el ends here
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el
index 82928642f3f..f6bf1127f5a 100644
--- a/lisp/mail/footnote.el
+++ b/lisp/mail/footnote.el
@@ -797,5 +797,4 @@ started, play around with the following keys:
(provide 'footnote)
-;; arch-tag: 9bcfb6d7-2161-4caf-8793-700f62400398
;;; footnote.el ends here
diff --git a/lisp/mail/hashcash.el b/lisp/mail/hashcash.el
index 5c6a69e6864..1108ff92c04 100644
--- a/lisp/mail/hashcash.el
+++ b/lisp/mail/hashcash.el
@@ -1,6 +1,7 @@
;;; hashcash.el --- Add hashcash payments to email
-;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation
+;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
+;; Free Software Foundation
;; Written by: Paul Foley <mycroft@actrix.gen.nz> (1997-2002)
;; Maintainer: Paul Foley <mycroft@actrix.gen.nz>
diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el
index 0125d52f55c..f322c57396f 100644
--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -1,7 +1,8 @@
;;; mail-extr.el --- extract full name and address from RFC 822 mail header -*- coding: utf-8 -*-
;; Copyright (C) 1991, 1992, 1993, 1994, 1997, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;; Free Software Foundation, Inc.
;; Author: Joe Wells <jbw@cs.bu.edu>
;; Maintainer: FSF
diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el
index afaf6949ca6..6a008ab8575 100644
--- a/lisp/mail/mail-hist.el
+++ b/lisp/mail/mail-hist.el
@@ -293,5 +293,4 @@ received mail."
(provide 'mail-hist)
-;; arch-tag: 9ff9a07c-9dca-482d-ba87-54f42778559d
;;; mail-hist.el ends here
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 0ec8f6dee2c..a9ce8247a6b 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -609,5 +609,4 @@ In other respects, this behaves like `end-of-buffer', which see."
(provide 'mailabbrev)
-;; arch-tag: 5aa2d901-73f8-4ad7-b73c-4802282ad2ff
;;; mailabbrev.el ends here
diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el
index e0352018903..53deaa46a4a 100644
--- a/lisp/mail/mailalias.el
+++ b/lisp/mail/mailalias.el
@@ -1,7 +1,8 @@
;;; mailalias.el --- expand and complete mailing address aliases
-;; Copyright (C) 1985, 1987, 1995, 1996, 1997, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1995, 1996, 1997, 2001, 2002, 2003, 2004,
+;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el
index b1da0458d8e..3c23abaf4e9 100644
--- a/lisp/mail/mailclient.el
+++ b/lisp/mail/mailclient.el
@@ -174,5 +174,4 @@ The mail client is taken to be the handler of mailto URLs."
(provide 'mailclient)
-;; arch-tag: 35d10fc8-a1bc-4f29-a4e6-c288e53578ef
;;; mailclient.el ends here
diff --git a/lisp/mail/mailheader.el b/lisp/mail/mailheader.el
index 56fa0c59791..752fcb62029 100644
--- a/lisp/mail/mailheader.el
+++ b/lisp/mail/mailheader.el
@@ -1,7 +1,7 @@
;;; mailheader.el --- mail header parsing, merging, formatting
-;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;; 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Erik Naggum <erik@naggum.no>
;; Keywords: tools, mail, news
diff --git a/lisp/mail/mailpost.el b/lisp/mail/mailpost.el
index 0790375388d..7c4bea830d8 100644
--- a/lisp/mail/mailpost.el
+++ b/lisp/mail/mailpost.el
@@ -102,5 +102,4 @@ site-init."
(provide 'mailpost)
-;; arch-tag: 1f8ca085-60a6-4eac-8efb-69ffec2fa124
;;; mailpost.el ends here
diff --git a/lisp/mail/metamail.el b/lisp/mail/metamail.el
index 2b900485b11..63f366d55aa 100644
--- a/lisp/mail/metamail.el
+++ b/lisp/mail/metamail.el
@@ -200,5 +200,4 @@ redisplayed as output is inserted."
(provide 'metamail)
-;; arch-tag: 52c0cb6f-d800-4776-9789-f0275cb5490e
;;; metamail.el ends here
diff --git a/lisp/mail/mspools.el b/lisp/mail/mspools.el
index 80c31924dd5..e89fd6c157d 100644
--- a/lisp/mail/mspools.el
+++ b/lisp/mail/mspools.el
@@ -1,7 +1,7 @@
;;; mspools.el --- show mail spools waiting to be read
-;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;; 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Stephen Eglen <stephen@gnu.org>
;; Maintainer: Stephen Eglen <stephen@gnu.org>
diff --git a/lisp/mail/reporter.el b/lisp/mail/reporter.el
index ba5c8e337c5..280be615c14 100644
--- a/lisp/mail/reporter.el
+++ b/lisp/mail/reporter.el
@@ -407,5 +407,4 @@ mail-sending package is used for editing and sending the message."
(provide 'reporter)
-;; arch-tag: 33612ff4-fbbc-4be2-b183-560ce9e0199b
;;; reporter.el ends here
diff --git a/lisp/mail/rfc822.el b/lisp/mail/rfc822.el
index ddaf7625981..1fefef7e278 100644
--- a/lisp/mail/rfc822.el
+++ b/lisp/mail/rfc822.el
@@ -324,5 +324,4 @@
(provide 'rfc822)
-;; arch-tag: 5d388a24-e173-40fb-9b8e-85269de44b37
;;; rfc822.el ends here
diff --git a/lisp/mail/rmail-spam-filter.el b/lisp/mail/rmail-spam-filter.el
index a5d8e59a3c8..aeb4de531a7 100644
--- a/lisp/mail/rmail-spam-filter.el
+++ b/lisp/mail/rmail-spam-filter.el
@@ -555,5 +555,4 @@ checks to see if the old format is used, and updates it if necessary."
(provide 'rmail-spam-filter)
-;; arch-tag: 03e1d45d-b72f-4dd7-8f04-e7fd78249746
;;; rmail-spam-fitler ends here
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 9bfcdea14ce..472df32927a 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -4263,7 +4263,7 @@ encoded string (and the same mask) will decode the string."
;;; Start of automatically extracted autoloads.
;;;### (autoloads (rmail-edit-current-message) "rmailedit" "rmailedit.el"
-;;;;;; "bdbcacaef237aab5ca6c8653dc52a044")
+;;;;;; "1602595714ff15197cf32727d6765c31")
;;; Generated autoloads from rmailedit.el
(autoload 'rmail-edit-current-message "rmailedit" "\
@@ -4275,7 +4275,7 @@ Edit the contents of this message.
;;;### (autoloads (rmail-next-labeled-message rmail-previous-labeled-message
;;;;;; rmail-read-label rmail-kill-label rmail-add-label) "rmailkwd"
-;;;;;; "rmailkwd.el" "46ac83afa76e3aa88eacf73237bd703e")
+;;;;;; "rmailkwd.el" "061943b8a3dfd5695715b36736827950")
;;; Generated autoloads from rmailkwd.el
(autoload 'rmail-add-label "rmailkwd" "\
@@ -4318,7 +4318,7 @@ With prefix argument N moves forward N messages with these labels.
;;;***
-;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "724fa72db9b6c804f7f69ad1da83fd39")
+;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "783deb7c855767051af119f1bfd8d84e")
;;; Generated autoloads from rmailmm.el
(autoload 'rmail-mime "rmailmm" "\
@@ -4344,7 +4344,7 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'.
;;;***
;;;### (autoloads (set-rmail-inbox-list) "rmailmsc" "rmailmsc.el"
-;;;;;; "fd5e2a8dc4f74ea2275525d7a2766bea")
+;;;;;; "f1d9be06745c78b90224da788f61c2d9")
;;; Generated autoloads from rmailmsc.el
(autoload 'set-rmail-inbox-list "rmailmsc" "\
@@ -4360,7 +4360,7 @@ This applies only to the current session.
;;;### (autoloads (rmail-sort-by-labels rmail-sort-by-lines rmail-sort-by-correspondent
;;;;;; rmail-sort-by-recipient rmail-sort-by-author rmail-sort-by-subject
-;;;;;; rmail-sort-by-date) "rmailsort" "rmailsort.el" "446f2e852393e72030b85a1a9230c7ac")
+;;;;;; rmail-sort-by-date) "rmailsort" "rmailsort.el" "8b20167ea495d683f83f980833e948e0")
;;; Generated autoloads from rmailsort.el
(autoload 'rmail-sort-by-date "rmailsort" "\
@@ -4419,7 +4419,7 @@ If prefix argument REVERSE is non-nil, sorts in reverse order.
;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic
;;;;;; rmail-summary-by-regexp rmail-summary-by-recipients rmail-summary-by-labels
-;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "267d6f740d6697a631dacbd86f583374")
+;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "b1d2ca7470a7d8baffe9e90a15a5b5e0")
;;; Generated autoloads from rmailsum.el
(autoload 'rmail-summary "rmailsum" "\
@@ -4467,7 +4467,7 @@ SENDERS is a string of regexps separated by commas.
;;;***
;;;### (autoloads (unforward-rmail-message undigestify-rmail-message)
-;;;;;; "undigest" "undigest.el" "2869c38a0051d0acab1a5968627fa57d")
+;;;;;; "undigest" "undigest.el" "1b5181e02606e49ede71604472250cc3")
;;; Generated autoloads from undigest.el
(autoload 'undigestify-rmail-message "undigest" "\
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el
index 3c1b1935d87..2d5659a4202 100644
--- a/lisp/mail/rmailedit.el
+++ b/lisp/mail/rmailedit.el
@@ -399,5 +399,4 @@ HEADER-DIFF should be a return value from `rmail-edit-diff-headers'."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 9524f335-12cc-4e95-9e9b-3208dc30550b
;;; rmailedit.el ends here
diff --git a/lisp/mail/rmailkwd.el b/lisp/mail/rmailkwd.el
index 4551454cd00..b9b69231b88 100644
--- a/lisp/mail/rmailkwd.el
+++ b/lisp/mail/rmailkwd.el
@@ -194,5 +194,4 @@ With prefix argument N moves forward N messages with these labels."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 1149979c-8e47-4333-9629-cf3dc887a6a7
;;; rmailkwd.el ends here
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index ba1f39798e3..1b0e446209a 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -274,11 +274,11 @@ It is called with one argument ENTITY."
"Return a vector describing the displayed region of a MIME-entity at POS.
Optional 2nd argument ENTITY is the MIME-entity at POS.
The value is a vector [ INDEX HEADER TAGLINE BODY END], where
+ INDEX: index into the returned vector indicating where POS is (1..3).
HEADER: the position of the beginning of a header
TAGLINE: the position of the beginning of a tagline
BODY: the position of the beginning of a body
- END: the position of the end of the entity.
- INDEX: index into the returned vector indicating where POS is."
+ END: the position of the end of the entity."
(save-excursion
(or entity
(setq entity (get-text-property pos 'rmail-mime-entity)))
@@ -319,74 +319,32 @@ The value is a vector [ INDEX HEADER TAGLINE BODY END], where
(setq end body-beg))
(vector index beg tagline-beg body-beg end)))))
-(defun rmail-mime-next-item ()
- "Move point to the next displayed item of the current MIME entity.
-A MIME entity has three items; header, tagline, and body.
-If we are in the last item of the entity, move point to the first
-item of the next entity. If we reach the end of buffer, move
-point to the first item of the first entity (i.e. the beginning
-of buffer)."
- (interactive)
- (if (rmail-mime-message-p)
- (let* ((segment (rmail-mime-entity-segment (point)))
- (next-pos (aref segment (1+ (aref segment 0))))
- (button (next-button (point))))
- (goto-char (if (and button (< (button-start button) next-pos))
- (button-start button)
- next-pos))
- (if (eobp)
- (goto-char (point-min))))))
-
-(defun rmail-mime-previous-item ()
- "Move point to the previous displayed item of the current MIME message.
-A MIME entity has three items; header, tagline, and body.
-If we are at the beginning of the first item of the entity, move
-point to the last item of the previous entity. If we reach the
-beginning of buffer, move point to the last item of the last
-entity."
- (interactive)
- (when (rmail-mime-message-p)
- (if (bobp)
- (goto-char (point-max)))
- (let* ((segment (rmail-mime-entity-segment (1- (point))))
- (prev-pos (aref segment (aref segment 0)))
- (button (previous-button (point))))
- (goto-char (if (and button (> (button-start button) prev-pos))
- (button-start button)
- prev-pos)))))
-
(defun rmail-mime-shown-mode (entity)
"Make MIME-entity ENTITY displayed by the default way."
(let ((new (aref (rmail-mime-entity-display entity) 1)))
(aset new 0 (aref (rmail-mime-entity-header entity) 2))
(aset new 1 (aref (rmail-mime-entity-tagline entity) 2))
- (aset new 2 (aref (rmail-mime-entity-body entity) 2))))
-
-(defun rmail-mime-hidden-mode (entity top)
- "Make MIME-entity ENTITY displayed in the hidden mode.
-If TOP is non-nil, display ENTITY only by the tagline.
-Otherwise, don't display ENTITY."
- (if top
- (let ((new (aref (rmail-mime-entity-display entity) 1)))
- (aset new 0 nil)
- (aset new 1 top)
- (aset new 2 nil)
- (aset (rmail-mime-entity-body entity) 2 nil))
- (let ((current (aref (rmail-mime-entity-display entity) 0)))
- (aset current 0 nil)
- (aset current 1 nil)
- (aset current 2 nil)))
+ (aset new 2 (aref (rmail-mime-entity-body entity) 2)))
+ (dolist (child (rmail-mime-entity-children entity))
+ (rmail-mime-shown-mode child)))
+
+(defun rmail-mime-hidden-mode (entity)
+ "Make MIME-entity ENTITY displayed in the hidden mode."
+ (let ((new (aref (rmail-mime-entity-display entity) 1)))
+ (aset new 0 nil)
+ (aset new 1 t)
+ (aset new 2 nil))
(dolist (child (rmail-mime-entity-children entity))
- (rmail-mime-hidden-mode child nil)))
+ (rmail-mime-hidden-mode child)))
(defun rmail-mime-raw-mode (entity)
"Make MIME-entity ENTITY displayed in the raw mode."
(let ((new (aref (rmail-mime-entity-display entity) 1)))
(aset new 0 'raw)
(aset new 1 nil)
- (aset new 2 'raw)
- (dolist (child (rmail-mime-entity-children entity))
- (rmail-mime-hidden-mode child nil))))
+ (aset new 2 'raw))
+ (dolist (child (rmail-mime-entity-children entity))
+ (rmail-mime-raw-mode child)))
(defun rmail-mime-toggle-raw (entity)
"Toggle on and off the raw display mode of MIME-entity ENTITY."
@@ -407,7 +365,7 @@ Otherwise, don't display ENTITY."
(restore-buffer-modified-p modified)))))
(defun rmail-mime-toggle-hidden ()
- "Toggle on and off the hidden display mode of MIME-entity ENTITY."
+ "Hide or show the body of MIME-entity at point."
(interactive)
(when (rmail-mime-message-p)
(let* ((rmail-mime-mbox-buffer rmail-view-buffer)
@@ -420,18 +378,19 @@ Otherwise, don't display ENTITY."
;; Enter the hidden mode.
(progn
;; If point is in the body part, move it to the tagline
- ;; (or the header if headline is not displayed).
+ ;; (or the header if tagline is not displayed).
(if (= (aref segment 0) 3)
(goto-char (aref segment 2)))
- (rmail-mime-hidden-mode entity t)
+ (rmail-mime-hidden-mode entity)
;; If the current entity is the topmost one, display the
;; header.
(if (and rmail-mime-mbox-buffer (= (aref segment 1) (point-min)))
(let ((new (aref (rmail-mime-entity-display entity) 1)))
(aset new 0 t))))
;; Enter the shown mode.
- (aset (rmail-mime-entity-body entity) 2 t)
- (rmail-mime-shown-mode entity))
+ (rmail-mime-shown-mode entity)
+ ;; Force this body shown.
+ (aset (aref (rmail-mime-entity-display entity) 1) 2 t))
(let ((inhibit-read-only t)
(modified (buffer-modified-p))
(rmail-mime-mbox-buffer rmail-view-buffer)
@@ -441,8 +400,8 @@ Otherwise, don't display ENTITY."
(rmail-mime-insert entity)
(restore-buffer-modified-p modified))))))
-(define-key rmail-mode-map "\t" 'rmail-mime-next-item)
-(define-key rmail-mode-map [backtab] 'rmail-mime-previous-item)
+(define-key rmail-mode-map "\t" 'forward-button)
+(define-key rmail-mode-map [backtab] 'backward-button)
(define-key rmail-mode-map "\r" 'rmail-mime-toggle-hidden)
;;; Handlers
@@ -454,7 +413,11 @@ to the tag line."
(insert "[")
(let ((tag (aref (rmail-mime-entity-tagline entity) 0)))
(if (> (length tag) 0) (insert (substring tag 1) ":")))
- (insert (car (rmail-mime-entity-type entity)))
+ (insert (car (rmail-mime-entity-type entity)) " ")
+ (insert-button (let ((new (aref (rmail-mime-entity-display entity) 1)))
+ (if (aref new 2) "Hide" "Show"))
+ :type 'rmail-mime-toggle
+ 'help-echo "mouse-2, RET: Toggle show/hide")
(dolist (item item-list)
(when item
(if (stringp item)
@@ -462,6 +425,26 @@ to the tag line."
(apply 'insert-button item))))
(insert "]\n"))
+(defun rmail-mime-update-tagline (entity)
+ "Update the current tag line for MIME-entity ENTITY."
+ (let ((inhibit-read-only t)
+ (modified (buffer-modified-p))
+ ;; If we are going to show the body, the new button label is
+ ;; "Hide". Otherwise, it's "Show".
+ (label (if (aref (aref (rmail-mime-entity-display entity) 1) 2) "Hide"
+ "Show"))
+ (button (next-button (point))))
+ ;; Go to the second character of the button "Show" or "Hide".
+ (goto-char (1+ (button-start button)))
+ (setq button (button-at (point)))
+ (save-excursion
+ (insert label)
+ (delete-region (point) (button-end button)))
+ (delete-region (button-start button) (point))
+ (put-text-property (point) (button-end button) 'rmail-mime-entity entity)
+ (restore-buffer-modified-p modified)
+ (forward-line 1)))
+
(defun rmail-mime-insert-header (header)
"Decode and insert a MIME-entity header HEADER in the current buffer.
HEADER is a vector [BEG END DEFAULT-STATUS].
@@ -478,12 +461,27 @@ See `rmail-mime-entity' for the detail."
(rmail-copy-headers (point) (aref header 1)))))
(rfc2047-decode-region pos (point))
(if (and last-coding-system-used (not rmail-mime-coding-system))
- (setq rmail-mime-coding-system last-coding-system-used))
+ (setq rmail-mime-coding-system (cons last-coding-system-used nil)))
(goto-char (point-min))
(rmail-highlight-headers)
(goto-char (point-max))
(insert "\n"))))
+(defun rmail-mime-find-header-encoding (header)
+ "Retun the last coding system used to decode HEADER.
+HEADER is a header component of a MIME-entity object (see
+`rmail-mime-entity')."
+ (with-temp-buffer
+ (let ((last-coding-system-used nil))
+ (with-current-buffer rmail-mime-mbox-buffer
+ (let ((rmail-buffer rmail-mime-mbox-buffer)
+ (rmail-view-buffer rmail-mime-view-buffer))
+ (save-excursion
+ (goto-char (aref header 0))
+ (rmail-copy-headers (point) (aref header 1)))))
+ (rfc2047-decode-region (point-min) (point-max))
+ last-coding-system-used)))
+
(defun rmail-mime-text-handler (content-type
content-disposition
content-transfer-encoding)
@@ -516,7 +514,7 @@ See `rmail-mime-entity' for the detail."
((string= transfer-encoding "quoted-printable")
(quoted-printable-decode-region pos (point))))))
(decode-coding-region pos (point) coding-system)
- (or rmail-mime-coding-system
+ (if (or (not rmail-mime-coding-system) (consp rmail-mime-coding-system))
(setq rmail-mime-coding-system coding-system))
(or (bolp) (insert "\n"))))
@@ -544,7 +542,10 @@ See `rmail-mime-entity' for the detail."
(rmail-mime-insert-header header)))
;; tagline
(if (eq (aref current 1) (aref new 1))
- (forward-char (- (aref segment 3) (aref segment 2)))
+ (if (or (not (aref current 1))
+ (eq (aref current 2) (aref new 2)))
+ (forward-char (- (aref segment 3) (aref segment 2)))
+ (rmail-mime-update-tagline entity))
(if (aref current 1)
(delete-char (- (aref segment 3) (aref segment 2))))
(if (aref new 1)
@@ -599,13 +600,13 @@ MIME-Version: 1.0
(insert-image (create-image data (cdr bulk-data) t))
(insert "\n")))
-(defun rmail-mime-image (button)
- "Display the image associated with BUTTON."
+(defun rmail-mime-toggle-button (button)
+ "Hide or show the body of the MIME-entity associated with BUTTON."
(save-excursion
- (goto-char (button-end button))
+ (goto-char (button-start button))
(rmail-mime-toggle-hidden)))
-(define-button-type 'rmail-mime-image 'action 'rmail-mime-image)
+(define-button-type 'rmail-mime-toggle 'action 'rmail-mime-toggle-button)
(defun rmail-mime-bulk-handler (content-type
@@ -628,7 +629,7 @@ directly."
(size (cdr (assq 'size (cdr (rmail-mime-entity-disposition entity)))))
(bulk-data (aref (rmail-mime-entity-tagline entity) 1))
(body (rmail-mime-entity-body entity))
- size type to-show)
+ type to-show)
(cond (size
(setq size (string-to-number size)))
((stringp (aref body 0))
@@ -662,7 +663,6 @@ directly."
(defun rmail-mime-insert-bulk (entity)
"Presentation handler for an attachment MIME entity."
- ;; Find the default directory for this media type.
(let* ((content-type (rmail-mime-entity-type entity))
(content-disposition (rmail-mime-entity-disposition entity))
(current (aref (rmail-mime-entity-display entity) 0))
@@ -671,6 +671,7 @@ directly."
(tagline (rmail-mime-entity-tagline entity))
(bulk-data (aref tagline 1))
(body (rmail-mime-entity-body entity))
+ ;; Find the default directory for this media type.
(directory (catch 'directory
(dolist (entry rmail-mime-attachment-dirs-alist)
(when (string-match (car entry) (car content-type))
@@ -711,13 +712,16 @@ directly."
;; tagline
(if (eq (aref current 1) (aref new 1))
- (forward-char (- (aref segment 3) (aref segment 2)))
+ (if (or (not (aref current 1))
+ (eq (aref current 2) (aref new 2)))
+ (forward-char (- (aref segment 3) (aref segment 2)))
+ (rmail-mime-update-tagline entity))
(if (aref current 1)
(delete-char (- (aref segment 3) (aref segment 2))))
(if (aref new 1)
(rmail-mime-insert-tagline
entity
- " file:"
+ " Save:"
(list filename
:type 'rmail-mime-save
'help-echo "mouse-2, RET: Save attachment"
@@ -725,14 +729,17 @@ directly."
'directory (file-name-as-directory directory)
'data data)
(format " (%.0f%s)" size (car units))
- (if (cdr bulk-data)
- " ")
- (if (cdr bulk-data)
- (list "Toggle show/hide"
- :type 'rmail-mime-image
- 'help-echo "mouse-2, RET: Toggle show/hide"
- 'image-type (cdr bulk-data)
- 'image-data data)))))
+ ;; We don't need this button because the "type" string of a
+ ;; tagline is the button to do this.
+ ;; (if (cdr bulk-data)
+ ;; " ")
+ ;; (if (cdr bulk-data)
+ ;; (list "Toggle show/hide"
+ ;; :type 'rmail-mime-image
+ ;; 'help-echo "mouse-2, RET: Toggle show/hide"
+ ;; 'image-type (cdr bulk-data)
+ ;; 'image-data data))
+ )))
;; body
(if (eq (aref current 2) (aref new 2))
(forward-char (- (aref segment 4) (aref segment 3)))
@@ -742,7 +749,11 @@ directly."
(cond ((eq (cdr bulk-data) 'text)
(rmail-mime-insert-decoded-text entity))
((cdr bulk-data)
- (rmail-mime-insert-image entity)))))
+ (rmail-mime-insert-image entity))
+ (t
+ ;; As we don't know how to display the body, just
+ ;; insert it as a text.
+ (rmail-mime-insert-decoded-text entity)))))
(put-text-property beg (point) 'rmail-mime-entity entity)))
(defun test-rmail-mime-bulk-handler ()
@@ -820,7 +831,9 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
(cond ((string-match "mixed" subtype)
(setq content-type '("text/plain")))
((string-match "digest" subtype)
- (setq content-type '("message/rfc822"))))
+ (setq content-type '("message/rfc822")))
+ (t
+ (setq content-type nil)))
;; Loop over all body parts, where beg points at the beginning of
;; the part and end points at the end of the part. next points at
@@ -877,8 +890,9 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
(setq second child)))))
(or best (not second) (setq best second))
(dolist (child entities)
- (or (eq best child)
- (rmail-mime-hidden-mode child t)))))
+ (unless (eq best child)
+ (aset (rmail-mime-entity-body child) 2 nil)
+ (rmail-mime-hidden-mode child)))))
entities)))
(defun test-rmail-mime-multipart-handler ()
@@ -930,21 +944,23 @@ This is the epilogue. It is also to be ignored."))
(rmail-mime-insert-header header)))
;; tagline
(if (eq (aref current 1) (aref new 1))
- (forward-char (- (aref segment 3) (aref segment 2)))
+ (if (or (not (aref current 1))
+ (eq (aref current 2) (aref new 2)))
+ (forward-char (- (aref segment 3) (aref segment 2)))
+ (rmail-mime-update-tagline entity))
(if (aref current 1)
(delete-char (- (aref segment 3) (aref segment 2))))
(if (aref new 1)
(rmail-mime-insert-tagline entity)))
(put-text-property beg (point) 'rmail-mime-entity entity)
+
;; body
(if (eq (aref current 2) (aref new 2))
(forward-char (- (aref segment 4) (aref segment 3)))
- (if (aref current 2)
- (delete-char (- (aref segment 4) (aref segment 3))))
- (if (aref new 2)
- (dolist (child (rmail-mime-entity-children entity))
- (rmail-mime-insert child))))))
+ (dolist (child (rmail-mime-entity-children entity))
+ (rmail-mime-insert child)))
+ entity))
;;; Main code
@@ -1005,7 +1021,16 @@ The parsed header value:
;; Everything else is an attachment.
(rmail-mime-bulk-handler content-type
content-disposition
- content-transfer-encoding)))
+ content-transfer-encoding))
+ (save-restriction
+ (widen)
+ (let ((entity (get-text-property (1- (point)) 'rmail-mime-entity))
+ current new)
+ (when entity
+ (setq current (aref (rmail-mime-entity-display entity) 0)
+ new (aref (rmail-mime-entity-display entity) 1))
+ (dotimes (i 3)
+ (aset current i (aref new i)))))))
(defun rmail-mime-show (&optional show-headers)
"Handle the current buffer as a MIME message.
@@ -1050,7 +1075,8 @@ modified."
(setq content-transfer-encoding (downcase content-transfer-encoding)))
(setq content-type
(if content-type
- (mail-header-parse-content-type content-type)
+ (or (mail-header-parse-content-type content-type)
+ '("text/plain"))
(or default-content-type '("text/plain"))))
(setq content-disposition
(if content-disposition
@@ -1178,13 +1204,20 @@ available."
(if (aref current 1)
(delete-char (- (aref segment 3) (aref segment 2))))
;; body
- (if (eq (aref current 2) (aref new 2))
- (forward-char (- (aref segment 4) (aref segment 3)))
- (if (aref current 2)
- (delete-char (- (aref segment 4) (aref segment 3))))
- (insert-buffer-substring rmail-mime-mbox-buffer
- (aref body 0) (aref body 1)))
- (put-text-property beg (point) 'rmail-mime-entity entity)))
+ (let ((children (rmail-mime-entity-children entity)))
+ (if children
+ (progn
+ (put-text-property beg (point) 'rmail-mime-entity entity)
+ (dolist (child children)
+ (rmail-mime-insert child)))
+ (if (eq (aref current 2) (aref new 2))
+ (forward-char (- (aref segment 4) (aref segment 3)))
+ (if (aref current 2)
+ (delete-char (- (aref segment 4) (aref segment 3))))
+ (insert-buffer-substring rmail-mime-mbox-buffer
+ (aref body 0) (aref body 1))
+ (or (bolp) (insert "\n")))
+ (put-text-property beg (point) 'rmail-mime-entity entity)))))
(dotimes (i 3)
(aset current i (aref new i)))))
@@ -1212,17 +1245,18 @@ displays text and multipart messages, and offers to download
attachments as specfied by `rmail-mime-attachment-dirs-alist'."
(interactive "P")
(if rmail-enable-mime
- (if (rmail-mime-message-p)
- (let ((rmail-mime-mbox-buffer rmail-view-buffer)
- (rmail-mime-view-buffer rmail-buffer)
- (entity (get-text-property (point) 'rmail-mime-entity)))
- (if arg
- (if entity
- (rmail-mime-toggle-raw entity))
- (goto-char (point-min))
- (rmail-mime-toggle-raw
- (get-text-property (point) 'rmail-mime-entity))))
- (message "Not a MIME message"))
+ (with-current-buffer rmail-buffer
+ (if (rmail-mime-message-p)
+ (let ((rmail-mime-mbox-buffer rmail-view-buffer)
+ (rmail-mime-view-buffer rmail-buffer)
+ (entity (get-text-property (point) 'rmail-mime-entity)))
+ (if arg
+ (if entity
+ (rmail-mime-toggle-raw entity))
+ (goto-char (point-min))
+ (rmail-mime-toggle-raw
+ (get-text-property (point) 'rmail-mime-entity))))
+ (message "Not a MIME message")))
(let* ((data (rmail-apply-in-message rmail-current-message 'buffer-string))
(buf (get-buffer-create "*RMAIL*"))
(rmail-mime-mbox-buffer rmail-view-buffer)
@@ -1256,8 +1290,19 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'."
(with-current-buffer rmail-mime-view-buffer
(erase-buffer)
(rmail-mime-insert entity)
- (if rmail-mime-coding-system
- (set-buffer-file-coding-system rmail-mime-coding-system t t)))
+ (if (consp rmail-mime-coding-system)
+ ;; Decoding is done by rfc2047-decode-region only for a
+ ;; header. But, as the used coding system may have been
+ ;; overriden by mm-charset-override-alist, we can't
+ ;; trust (car rmail-mime-coding-system). So, here we
+ ;; try the decoding again with mm-charset-override-alist
+ ;; bound to nil.
+ (let ((mm-charset-override-alist nil))
+ (setq rmail-mime-coding-system
+ (rmail-mime-find-header-encoding
+ (rmail-mime-entity-header entity)))))
+ (set-buffer-file-coding-system
+ (coding-system-base rmail-mime-coding-system) t t))
;; Decoding failed. ENTITY is an error message. Insert the
;; original message body as is, and show warning.
(let ((region (with-current-buffer rmail-mime-mbox-buffer
@@ -1340,5 +1385,4 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 3f2c5e5d-1aef-4512-bc20-fd737c9d5dd9
;;; rmailmm.el ends here
diff --git a/lisp/mail/rmailmsc.el b/lisp/mail/rmailmsc.el
index 919f52a8881..884a6b96d9c 100644
--- a/lisp/mail/rmailmsc.el
+++ b/lisp/mail/rmailmsc.el
@@ -59,5 +59,4 @@ This applies only to the current session."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 94614a62-2a0a-4e25-bac9-06f461ed4c60
;;; rmailmsc.el ends here
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index 969bce938bb..f630b92d520 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -603,5 +603,4 @@ than appending to it. Deletes the message after writing if
(if rmail-delete-after-output
(rmail-delete-forward)))
-;; arch-tag: 4059abf0-f249-4be4-8e0d-602d370d01d1
;;; rmailout.el ends here
diff --git a/lisp/mail/rmailsort.el b/lisp/mail/rmailsort.el
index 44204a4b918..38e24295e8f 100644
--- a/lisp/mail/rmailsort.el
+++ b/lisp/mail/rmailsort.el
@@ -255,5 +255,4 @@ Numeric keys are sorted numerically, all others as strings."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 665da245-f6a7-4115-ad8c-ba19216988d5
;;; rmailsort.el ends here
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 73e009ea697..3c45c4d7914 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -1847,5 +1847,4 @@ the summary is only showing a subset of messages."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 80b0a27a-a50d-4f37-9466-83d32d1e0ca8
;;; rmailsum.el ends here
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el
index e37c7a0149f..e73897e61c4 100644
--- a/lisp/mail/supercite.el
+++ b/lisp/mail/supercite.el
@@ -1997,5 +1997,4 @@ version at point."
(provide 'supercite)
(run-hooks 'sc-load-hook)
-;; arch-tag: a5d5bfa6-3bd5-4414-8c65-0afc83e45cd3
;;; supercite.el ends here
diff --git a/lisp/mail/uce.el b/lisp/mail/uce.el
index e71dd9cea22..d322ccaaf8d 100644
--- a/lisp/mail/uce.el
+++ b/lisp/mail/uce.el
@@ -375,5 +375,4 @@ You might need to set `uce-mail-reader' before using this."
(provide 'uce)
-;; arch-tag: 44b68c87-9b29-47bd-822c-3feee3883221
;;; uce.el ends here
diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el
index 0403c4afc6c..3818b6aa45c 100644
--- a/lisp/mail/undigest.el
+++ b/lisp/mail/undigest.el
@@ -329,5 +329,4 @@ following the containing message."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 3a28b9fb-c1f5-43ef-9278-285f3e4b874d
;;; undigest.el ends here
diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el
index 4aa727f9f50..f358968a26b 100644
--- a/lisp/mail/unrmail.el
+++ b/lisp/mail/unrmail.el
@@ -245,5 +245,4 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'."
(provide 'unrmail)
-;; arch-tag: 14c6290d-60b2-456f-8909-5c2387de6acb
;;; unrmail.el ends here