aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2009-02-16 01:18:38 +0000
committerGlenn Morris2009-02-16 01:18:38 +0000
commitd4653d3c30fe35f88cffd9e798f33ac90619bd28 (patch)
tree6c53d2bbee63bb42c843aca63198a6ccd1dd1611
parentdfeab39416f6076ceaf6cff8a5ba4fa526dee947 (diff)
downloademacs-d4653d3c30fe35f88cffd9e798f33ac90619bd28.tar.gz
emacs-d4653d3c30fe35f88cffd9e798f33ac90619bd28.zip
(rmail-delete-unwanted-fields)
(rmail-output-as-babyl, rmail-output-to-babyl-buffer) (rmail-convert-to-babyl-format, rmail-nuke-pinhead-header) (rmail-output-as-mbox, rmail-output-to-rmail-buffer, rmail-output) (rmail-output-as-seen, rmail-output-body-to-file): Doc fixes.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/mail/rmailout.el75
2 files changed, 54 insertions, 29 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ea988d17f26..dd6b376a988 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12009-02-16 Glenn Morris <rgm@gnu.org>
2
3 * mail/rmailout.el (rmail-delete-unwanted-fields)
4 (rmail-output-as-babyl, rmail-output-to-babyl-buffer)
5 (rmail-convert-to-babyl-format, rmail-nuke-pinhead-header)
6 (rmail-output-as-mbox, rmail-output-to-rmail-buffer, rmail-output)
7 (rmail-output-as-seen, rmail-output-body-to-file): Doc fixes.
8
12009-02-15 Glenn Morris <rgm@gnu.org> 92009-02-15 Glenn Morris <rgm@gnu.org>
2 10
3 * mail/rmailsum.el (rmail-summary-output-as-seen): Doc fix. 11 * mail/rmailsum.el (rmail-summary-output-as-seen): Doc fix.
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index 0d3047c5060..3c762ed82cf 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -84,10 +84,10 @@ Set `rmail-default-file' to this name as well as returning it."
84 (or read-file (file-name-nondirectory default-file)) 84 (or read-file (file-name-nondirectory default-file))
85 (file-name-directory default-file))))))) 85 (file-name-directory default-file)))))))
86 86
87;; Delete from the buffer header fields we don't want output.
88;; Buffer should be pre-narrowed to the header.
89;; PRESERVE is a regexp for fields NEVER to delete.
90(defun rmail-delete-unwanted-fields (preserve) 87(defun rmail-delete-unwanted-fields (preserve)
88 "Delete all headers matching `rmail-fields-not-to-output'.
89Retains headers matching the regexp PRESERVE. The buffer should be
90narrowed to just the header."
91 (if rmail-fields-not-to-output 91 (if rmail-fields-not-to-output
92 (save-excursion 92 (save-excursion
93 (goto-char (point-min)) 93 (goto-char (point-min))
@@ -99,9 +99,13 @@ Set `rmail-default-file' to this name as well as returning it."
99 99
100(defun rmail-output-as-babyl (file-name nomsg) 100(defun rmail-output-as-babyl (file-name nomsg)
101 "Convert the current buffer's text to Babyl and output to FILE-NAME. 101 "Convert the current buffer's text to Babyl and output to FILE-NAME.
102It alters the current buffer's text, so it should be a temp buffer." 102Alters the current buffer's text, so it should be a temporary buffer.
103 (let ((coding-system-for-write 103If a buffer is visiting FILE-NAME, adds the text to that buffer
104 'emacs-mule-unix)) 104rather than saving the file directly. If the buffer is an Rmail buffer,
105updates it accordingly. If no buffer is visiting FILE-NAME, appends
106the text directly to FILE-NAME, and displays a \"Wrote file\" message
107unless NOMSG is a symbol (neither nil nor t)."
108 (let ((coding-system-for-write 'emacs-mule-unix))
105 (save-restriction 109 (save-restriction
106 (goto-char (point-min)) 110 (goto-char (point-min))
107 (search-forward "\n\n" nil 'move) 111 (search-forward "\n\n" nil 'move)
@@ -134,11 +138,10 @@ It alters the current buffer's text, so it should be a temp buffer."
134(declare-function rmail-update-summary "rmailsum" (&rest ignore)) 138(declare-function rmail-update-summary "rmailsum" (&rest ignore))
135 139
136(defun rmail-output-to-babyl-buffer (tembuf msg) 140(defun rmail-output-to-babyl-buffer (tembuf msg)
137 "Copy msg in TEMBUF from BEG to END into this old R-mail BABYL buffer. 141 "Copy message in TEMBUF into the current Babyl Rmail buffer.
138Do what is necessary to make babyl R-mail know about the new message. 142Do what is necessary to make Rmail know about the new message, then
139Then display message number MSG." 143display message number MSG."
140 ;; Turn on Auto Save mode, if it's off in this 144 ;; Turn on Auto Save mode, if it's off in this buffer but enabled by default.
141 ;; buffer but enabled by default.
142 (and (not buffer-auto-save-file-name) 145 (and (not buffer-auto-save-file-name)
143 auto-save-default 146 auto-save-default
144 (auto-save-mode t)) 147 (auto-save-mode t))
@@ -152,11 +155,11 @@ Then display message number MSG."
152 (narrow-to-region (point) (point-max)) 155 (narrow-to-region (point) (point-max))
153 (rmail-count-new-messages t) 156 (rmail-count-new-messages t)
154 (if (rmail-summary-exists) 157 (if (rmail-summary-exists)
155 (rmail-select-summary 158 (rmail-select-summary (rmail-update-summary)))
156 (rmail-update-summary)))
157 (rmail-show-message-1 msg)) 159 (rmail-show-message-1 msg))
158 160
159(defun rmail-convert-to-babyl-format () 161(defun rmail-convert-to-babyl-format ()
162 "Convert the mbox message in the current buffer to Babyl format."
160 (let ((count 0) (start (point-min)) 163 (let ((count 0) (start (point-min))
161 (case-fold-search nil) 164 (case-fold-search nil)
162 (buffer-undo-list t)) 165 (buffer-undo-list t))
@@ -251,11 +254,11 @@ Then display message number MSG."
251 (symbol-name last-coding-system-used) 254 (symbol-name last-coding-system-used)
252 "\n"))))) 255 "\n")))))
253 256
254;; Delete the "From ..." line, creating various other headers with
255;; information from it if they don't already exist. Now puts the
256;; original line into a mail-from: header line for debugging and for
257;; use by the rmail-output function.
258(defun rmail-nuke-pinhead-header () 257(defun rmail-nuke-pinhead-header ()
258 "Delete the \"From \" line in the current mbox message.
259The variable `rmail-unix-mail-delimiter' specifies the From line format.
260Replaces the From line with a \"Mail-from\" header. Adds \"Date\" and
261\"From\" headers if they are not already present."
259 (save-excursion 262 (save-excursion
260 (save-restriction 263 (save-restriction
261 (let ((start (point)) 264 (let ((start (point))
@@ -306,8 +309,12 @@ Then display message number MSG."
306 309
307(defun rmail-output-as-mbox (file-name nomsg &optional as-seen) 310(defun rmail-output-as-mbox (file-name nomsg &optional as-seen)
308 "Convert the current buffer's text to mbox and output to FILE-NAME. 311 "Convert the current buffer's text to mbox and output to FILE-NAME.
309It alters the current buffer's text, so call with a temp buffer current. 312Alters the current buffer's text, so it should be a temporary buffer.
310If FILE-NAME is visited, output into its buffer instead. 313If a buffer is visiting FILE-NAME, adds the text to that buffer
314rather than saving the file directly. If the buffer is an Rmail buffer,
315updates it accordingly. If no buffer is visiting FILE-NAME, appends
316the text directly to FILE-NAME, and displays a \"Wrote file\" message
317unless NOMSG is a symbol (neither nil nor t).
311AS-SEEN is non-nil if we are copying the message \"as seen\"." 318AS-SEEN is non-nil if we are copying the message \"as seen\"."
312 (let ((case-fold-search t) 319 (let ((case-fold-search t)
313 from date) 320 from date)
@@ -363,9 +370,9 @@ AS-SEEN is non-nil if we are copying the message \"as seen\"."
363 (insert-buffer-substring tembuf))))))) 370 (insert-buffer-substring tembuf)))))))
364 371
365(defun rmail-output-to-rmail-buffer (tembuf msg) 372(defun rmail-output-to-rmail-buffer (tembuf msg)
366 "Copy msg in TEMBUF from BEG to END into this Rmail buffer. 373 "Copy message in TEMBUF into the current Rmail buffer.
367Do what is necessary to make Rmail know about the new message. 374Do what is necessary to make Rmail know about the new message. then
368Then display message number MSG." 375display message number MSG."
369 (save-excursion 376 (save-excursion
370 (rmail-swap-buffers-maybe) 377 (rmail-swap-buffers-maybe)
371 ;; Turn on Auto Save mode, if it's off in this 378 ;; Turn on Auto Save mode, if it's off in this
@@ -378,8 +385,7 @@ Then display message number MSG."
378 (insert-buffer-substring tembuf) 385 (insert-buffer-substring tembuf)
379 (rmail-count-new-messages t) 386 (rmail-count-new-messages t)
380 (if (rmail-summary-exists) 387 (if (rmail-summary-exists)
381 (rmail-select-summary 388 (rmail-select-summary (rmail-update-summary)))
382 (rmail-update-summary)))
383 (rmail-show-message-1 msg))) 389 (rmail-show-message-1 msg)))
384 390
385;;; There are functions elsewhere in Emacs that use this function; 391;;; There are functions elsewhere in Emacs that use this function;
@@ -389,8 +395,11 @@ Then display message number MSG."
389 "Append this message to mail file FILE-NAME. 395 "Append this message to mail file FILE-NAME.
390This works with both mbox format and Babyl format files, 396This works with both mbox format and Babyl format files,
391outputting in the appropriate format for each. 397outputting in the appropriate format for each.
392The default file name comes from `rmail-default-file', 398
393which is updated to the name you use in this command. 399Interactively, the default file name comes from `rmail-default-file',
400which is updated to the name you use in this command. In all uses, if
401FILE-NAME is not absolute, it is expanded with the directory part of
402`rmail-default-file'.
394 403
395A prefix argument COUNT says to output that many consecutive messages, 404A prefix argument COUNT says to output that many consecutive messages,
396starting with the current one. Deleted messages are skipped and don't count. 405starting with the current one. Deleted messages are skipped and don't count.
@@ -402,7 +411,7 @@ even if the header display is currently pruned.
402The optional third argument NOATTRIBUTE, if non-nil, says not 411The optional third argument NOATTRIBUTE, if non-nil, says not
403to set the `filed' attribute, and not to display a message. 412to set the `filed' attribute, and not to display a message.
404 413
405The optional fourth argument FROM-GNUS is set when called from GNUS." 414The optional fourth argument FROM-GNUS is set when called from Gnus."
406 (interactive 415 (interactive
407 (list (rmail-output-read-file-name) 416 (list (rmail-output-read-file-name)
408 (prefix-numeric-value current-prefix-arg))) 417 (prefix-numeric-value current-prefix-arg)))
@@ -481,7 +490,7 @@ which is updated to the name you use in this command.
481The optional third argument NOATTRIBUTE, if non-nil, says not 490The optional third argument NOATTRIBUTE, if non-nil, says not
482to set the `filed' attribute, and not to display a message. 491to set the `filed' attribute, and not to display a message.
483 492
484The optional fourth argument FROM-GNUS is set when called from GNUS." 493The optional fourth argument FROM-GNUS is set when called from Gnus."
485 (interactive 494 (interactive
486 (list (rmail-output-read-file-name) 495 (list (rmail-output-read-file-name)
487 (prefix-numeric-value current-prefix-arg))) 496 (prefix-numeric-value current-prefix-arg)))
@@ -552,7 +561,15 @@ The optional fourth argument FROM-GNUS is set when called from GNUS."
552;;;###autoload 561;;;###autoload
553(defun rmail-output-body-to-file (file-name) 562(defun rmail-output-body-to-file (file-name)
554 "Write this message body to the file FILE-NAME. 563 "Write this message body to the file FILE-NAME.
555FILE-NAME defaults, interactively, from the Subject field of the message." 564Interactively, the default file name comes from either the message
565\"Subject\" header, or from `rmail-default-body-file'. Updates the value
566of `rmail-default-body-file' accordingly. In all uses, if FILE-NAME
567is not absolute, it is expanded with the directory part of
568`rmail-default-body-file'.
569
570Note that this overwrites FILE-NAME (after confirmation), rather
571than appending to it. Deletes the message after writing if
572`rmail-delete-after-output' is non-nil."
556 (interactive 573 (interactive
557 (let ((default-file 574 (let ((default-file
558 (or (mail-fetch-field "Subject") 575 (or (mail-fetch-field "Subject")