aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-12-06 20:37:14 -0800
committerGlenn Morris2012-12-06 20:37:14 -0800
commit13a40633cfb5d3b97f26b362c27ffb50846dc1bb (patch)
tree28f32756da75f92ca1ee0b80057c1f5781a69502
parent4611a3cce757d835a812820e2a65bdc56441463a (diff)
downloademacs-13a40633cfb5d3b97f26b362c27ffb50846dc1bb.tar.gz
emacs-13a40633cfb5d3b97f26b362c27ffb50846dc1bb.zip
Default to mboxrd in Rmail, allow mboxo as an option
* lisp/mail/unrmail.el (unrmail-mbox-format): New option. (batch-unrmail, unrmail): Doc fixes. (unrmail): Respect unrmail-mbox-format. * lisp/mail/rmail.el (rmail-mbox-format): New option. (rmail-show-message-1): Respect rmail-mbox-format. * etc/NEWS: Related edits. Fixes: debbugs:6574
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/mail/rmail.el36
-rw-r--r--lisp/mail/unrmail.el41
4 files changed, 77 insertions, 16 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 39b04da387c..242b8929fd2 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -58,6 +58,14 @@ amounts of data into the ERC input.
58** MH-E has been updated to MH-E version 8.4. 58** MH-E has been updated to MH-E version 8.4.
59See MH-E-NEWS for details. 59See MH-E-NEWS for details.
60 60
61---
62** The unrmail command converts from BABYL to mboxrd rather than mboxo.
63Customize `unrmail-mbox-format' to change this.
64
65---
66** Similarly, customize `rmail-mbox-format' to influence some minor aspects
67of how Rmail displays non-MIME messages.
68
61+++ 69+++
62** New function `ses-rename-cell' to give SES cells arbitrary names. 70** New function `ses-rename-cell' to give SES cells arbitrary names.
63 71
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 51d2ec6cbd1..940dc62fedf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12012-12-07 Glenn Morris <rgm@gnu.org>
2
3 * mail/unrmail.el (unrmail-mbox-format): New option. (Bug#6574)
4 (batch-unrmail, unrmail): Doc fixes.
5 (unrmail): Respect unrmail-mbox-format.
6 * mail/rmail.el (rmail-mbox-format): New option.
7 (rmail-show-message-1): Respect rmail-mbox-format.
8
12012-12-07 Stefan Monnier <monnier@iro.umontreal.ca> 92012-12-07 Stefan Monnier <monnier@iro.umontreal.ca>
2 10
3 * emacs-lisp/cl-macs.el (cl-tagbody): New macro. 11 * emacs-lisp/cl-macs.el (cl-tagbody): New macro.
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 372b120046c..b16f501a999 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -2699,6 +2699,27 @@ N defaults to the current message."
2699 :group 'rmail 2699 :group 'rmail
2700 :version "23.1") 2700 :version "23.1")
2701 2701
2702;; FIXME?
2703;; rmail-show-mime-function does not unquote >From lines. Should it?
2704(defcustom rmail-mbox-format 'mboxrd
2705 "The mbox format that your system uses.
2706There is no way to determine this, so you should set the appropriate value.
2707The formats quote lines containing \"From \" differently.
2708The choices are:
2709 `mboxo' : lines that start with \"From \" quoted as \">From \"
2710 `mboxrd': lines that start with \">*From \" quoted with another \">\"
2711The `mboxo' format is ambiguous, in that one cannot know whether
2712a line starting with \">From \" originally had a \">\" or not.
2713
2714It is not critical to set this to the correct value; it only affects
2715how Rmail displays lines starting with \">*From \" in non-MIME messages.
2716
2717See also `unrmail-mbox-format'."
2718 :type '(choice (const 'mboxrd)
2719 (const 'mboxro))
2720 :version "24.4"
2721 :group 'rmail)
2722
2702(defun rmail-show-message-1 (&optional msg) 2723(defun rmail-show-message-1 (&optional msg)
2703 "Show message MSG (default: current message) using `rmail-view-buffer'. 2724 "Show message MSG (default: current message) using `rmail-view-buffer'.
2704Return text to display in the minibuffer if MSG is out of 2725Return text to display in the minibuffer if MSG is out of
@@ -2791,11 +2812,15 @@ The current mail message becomes the message displayed."
2791 ;; Prepare the separator (blank line) before the body. 2812 ;; Prepare the separator (blank line) before the body.
2792 (goto-char (point-min)) 2813 (goto-char (point-min))
2793 (insert "\n") 2814 (insert "\n")
2794 ;; Unquote quoted From lines 2815 ;; Unquote quoted From lines.
2795 (while (re-search-forward "^>+From " nil t) 2816 (let ((fromline (if (eq 'mboxrd rmail-mbox-format)
2796 (beginning-of-line) 2817 "^>+From "
2797 (delete-char 1) 2818 "^>From "))
2798 (forward-line)) 2819 case-fold-search)
2820 (while (re-search-forward fromline nil t)
2821 (beginning-of-line)
2822 (delete-char 1)
2823 (forward-line)))
2799 (goto-char (point-min))) 2824 (goto-char (point-min)))
2800 ;; Copy the headers to the front of the message view buffer. 2825 ;; Copy the headers to the front of the message view buffer.
2801 (rmail-copy-headers beg end) 2826 (rmail-copy-headers beg end)
@@ -3869,6 +3894,7 @@ see the documentation of `rmail-resend'."
3869 (msgnum rmail-current-message) 3894 (msgnum rmail-current-message)
3870 (subject (concat "[" 3895 (subject (concat "["
3871 (let ((from (or (mail-fetch-field "From") 3896 (let ((from (or (mail-fetch-field "From")
3897 ;; FIXME - huh?
3872 (mail-fetch-field ">From")))) 3898 (mail-fetch-field ">From"))))
3873 (if from 3899 (if from
3874 (concat (mail-strip-quoted-names from) ": ") 3900 (concat (mail-strip-quoted-names from) ": ")
diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el
index bf7b9abe2c1..23675d90713 100644
--- a/lisp/mail/unrmail.el
+++ b/lisp/mail/unrmail.el
@@ -1,6 +1,6 @@
1;;; unrmail.el --- convert Rmail Babyl files to mailbox files 1;;; unrmail.el --- convert Rmail Babyl files to mbox files
2 2
3;; Copyright (C) 1992, 2001-2012 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 2001-2012 Free Software Foundation, Inc.
4 4
5;; Maintainer: FSF 5;; Maintainer: FSF
6;; Keywords: mail 6;; Keywords: mail
@@ -26,7 +26,7 @@
26 26
27;;;###autoload 27;;;###autoload
28(defun batch-unrmail () 28(defun batch-unrmail ()
29 "Convert old-style Rmail Babyl files to system inbox format. 29 "Convert old-style Rmail Babyl files to mbox format.
30Specify the input Rmail Babyl file names as command line arguments. 30Specify the input Rmail Babyl file names as command line arguments.
31For each Rmail file, the corresponding output file name 31For each Rmail file, the corresponding output file name
32is made by adding `.mail' at the end. 32is made by adding `.mail' at the end.
@@ -45,9 +45,26 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'."
45(declare-function mail-mbox-from "mail-utils" ()) 45(declare-function mail-mbox-from "mail-utils" ())
46(defvar rmime-magic-string) ; in rmime.el, if you have it 46(defvar rmime-magic-string) ; in rmime.el, if you have it
47 47
48(defcustom unrmail-mbox-format 'mboxrd
49 "The mbox format that `unrmail' should produce.
50These formats separate messages using lines that start with \"From \".
51Therefore any lines in the message bodies that start with \"From \"
52must be quoted. The `mboxo' format just prepends a \">\" to such lines.
53This is not reversible, because given a line starting with \">From \" in
54an mboxo file, it is not possible to know whether the original had a \">\"
55or not. The `mxbord' format avoids this by also quoting \">From \" as
56\">>From \", and so on. For this reason, mboxrd is recommended.
57
58See also `rmail-mbox-format'."
59 :type '(choice (const 'mboxrd)
60 (const 'mboxro))
61 :version "24.4"
62 :group 'rmail)
63
48;;;###autoload 64;;;###autoload
49(defun unrmail (file to-file) 65(defun unrmail (file to-file)
50 "Convert old-style Rmail Babyl file FILE to system inbox format file TO-FILE." 66 "Convert old-style Rmail Babyl file FILE to mbox format file TO-FILE.
67The variable `unrmail-mbox-format' controls which mbox format to use."
51 (interactive "fUnrmail (babyl file): \nFUnrmail into (new mailbox file): ") 68 (interactive "fUnrmail (babyl file): \nFUnrmail into (new mailbox file): ")
52 (with-temp-buffer 69 (with-temp-buffer
53 ;; Read in the old Rmail file with no decoding. 70 ;; Read in the old Rmail file with no decoding.
@@ -224,13 +241,15 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'."
224 (when keywords 241 (when keywords
225 (insert "X-RMAIL-KEYWORDS: " keywords "\n")) 242 (insert "X-RMAIL-KEYWORDS: " keywords "\n"))
226 (goto-char (point-min)) 243 (goto-char (point-min))
227 ;; ``Quote'' "\nFrom " as "\n>From " 244 ;; Convert From to >From, etc.
228 ;; (note that this isn't really quoting, as there is no requirement 245 (let ((case-fold-search nil)
229 ;; that "\n[>]+From " be quoted in the same transparent way.) 246 (fromline (if (eq 'mboxrd unrmail-mbox-format)
230 (let ((case-fold-search nil)) 247 "^>*From "
231 (while (search-forward "\nFrom " nil t) 248 "^From ")))
232 (forward-char -5) 249 (while (re-search-forward fromline nil t)
233 (insert ?>))) 250 (beginning-of-line)
251 (insert ?>)
252 (forward-line 1)))
234 (goto-char (point-max)) 253 (goto-char (point-max))
235 ;; Add terminator blank line to message. 254 ;; Add terminator blank line to message.
236 (insert "\n") 255 (insert "\n")