diff options
| author | Glenn Morris | 2009-02-15 02:51:21 +0000 |
|---|---|---|
| committer | Glenn Morris | 2009-02-15 02:51:21 +0000 |
| commit | aab4c09b6b424e17e69d815e26d30405b9ec4378 (patch) | |
| tree | 7c7379c62590146600f4a4a4c78fa3f6fdc8eadb | |
| parent | 59a6d2495ae591fd9ad1e7c9c667cfc57e6efb78 (diff) | |
| download | emacs-aab4c09b6b424e17e69d815e26d30405b9ec4378.tar.gz emacs-aab4c09b6b424e17e69d815e26d30405b9ec4378.zip | |
(rmail-output-decode-coding): Fix custom type, group.
(rmail-output-as-babyl, rmail-output-to-babyl-buffer): Remove
unnecessary use of with-no-warnings.
(rmail-output-as-mbox, rmail-output-as-seen): Doc fix.
| -rw-r--r-- | lisp/mail/rmailout.el | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el index 9b988dd2863..31de99e7d29 100644 --- a/lisp/mail/rmailout.el +++ b/lisp/mail/rmailout.el | |||
| @@ -30,9 +30,8 @@ | |||
| 30 | 30 | ||
| 31 | (defcustom rmail-output-decode-coding nil | 31 | (defcustom rmail-output-decode-coding nil |
| 32 | "If non-nil, do coding system decoding when outputting message as Babyl." | 32 | "If non-nil, do coding system decoding when outputting message as Babyl." |
| 33 | :type '(choice (const :tag "on" t) | 33 | :type 'boolean |
| 34 | (const :tag "off" nil)) | 34 | :group 'rmail-output) |
| 35 | :group 'rmail) | ||
| 36 | 35 | ||
| 37 | (defcustom rmail-output-file-alist nil | 36 | (defcustom rmail-output-file-alist nil |
| 38 | "Alist matching regexps to suggested output Rmail files. | 37 | "Alist matching regexps to suggested output Rmail files. |
| @@ -47,6 +46,12 @@ a file name as a string." | |||
| 47 | sexp))) | 46 | sexp))) |
| 48 | :group 'rmail-output) | 47 | :group 'rmail-output) |
| 49 | 48 | ||
| 49 | (defcustom rmail-fields-not-to-output nil | ||
| 50 | "Regexp describing fields to exclude when outputting a message to a file." | ||
| 51 | :type '(choice (const :tag "None" nil) | ||
| 52 | regexp) | ||
| 53 | :group 'rmail-output) | ||
| 54 | |||
| 50 | (defun rmail-output-read-file-name () | 55 | (defun rmail-output-read-file-name () |
| 51 | "Read the file name to use for `rmail-output'. | 56 | "Read the file name to use for `rmail-output'. |
| 52 | Set `rmail-default-file' to this name as well as returning it." | 57 | Set `rmail-default-file' to this name as well as returning it." |
| @@ -79,12 +84,6 @@ Set `rmail-default-file' to this name as well as returning it." | |||
| 79 | (or read-file (file-name-nondirectory default-file)) | 84 | (or read-file (file-name-nondirectory default-file)) |
| 80 | (file-name-directory default-file))))))) | 85 | (file-name-directory default-file))))))) |
| 81 | 86 | ||
| 82 | (defcustom rmail-fields-not-to-output nil | ||
| 83 | "Regexp describing fields to exclude when outputting a message to a file." | ||
| 84 | :type '(choice (const :tag "None" nil) | ||
| 85 | regexp) | ||
| 86 | :group 'rmail-output) | ||
| 87 | |||
| 88 | ;; Delete from the buffer header fields we don't want output. | 87 | ;; Delete from the buffer header fields we don't want output. |
| 89 | ;; Buffer should be pre-narrowed to the header. | 88 | ;; Buffer should be pre-narrowed to the header. |
| 90 | ;; PRESERVE is a regexp for fields NEVER to delete. | 89 | ;; PRESERVE is a regexp for fields NEVER to delete. |
| @@ -122,9 +121,7 @@ It alters the current buffer's text, so it should be a temp buffer." | |||
| 122 | ;; File has been visited, in buffer BUF. | 121 | ;; File has been visited, in buffer BUF. |
| 123 | (set-buffer buf) | 122 | (set-buffer buf) |
| 124 | (let ((inhibit-read-only t) | 123 | (let ((inhibit-read-only t) |
| 125 | (msg (with-no-warnings | 124 | (msg (bound-and-true-p rmail-current-message))) |
| 126 | (and (boundp 'rmail-current-message) | ||
| 127 | rmail-current-message)))) | ||
| 128 | ;; If MSG is non-nil, buffer is in RMAIL mode. | 125 | ;; If MSG is non-nil, buffer is in RMAIL mode. |
| 129 | (if msg | 126 | (if msg |
| 130 | (rmail-output-to-babyl-buffer tembuf msg) | 127 | (rmail-output-to-babyl-buffer tembuf msg) |
| @@ -137,25 +134,24 @@ It alters the current buffer's text, so it should be a temp buffer." | |||
| 137 | "Copy msg in TEMBUF from BEG to END into this old R-mail BABYL buffer. | 134 | "Copy msg in TEMBUF from BEG to END into this old R-mail BABYL buffer. |
| 138 | Do what is necessary to make babyl R-mail know about the new message. | 135 | Do what is necessary to make babyl R-mail know about the new message. |
| 139 | Then display message number MSG." | 136 | Then display message number MSG." |
| 140 | (with-no-warnings | 137 | ;; Turn on Auto Save mode, if it's off in this |
| 141 | ;; Turn on Auto Save mode, if it's off in this | 138 | ;; buffer but enabled by default. |
| 142 | ;; buffer but enabled by default. | 139 | (and (not buffer-auto-save-file-name) |
| 143 | (and (not buffer-auto-save-file-name) | 140 | auto-save-default |
| 144 | auto-save-default | 141 | (auto-save-mode t)) |
| 145 | (auto-save-mode t)) | 142 | (rmail-maybe-set-message-counters) |
| 146 | (rmail-maybe-set-message-counters) | 143 | (widen) |
| 147 | (widen) | 144 | (narrow-to-region (point-max) (point-max)) |
| 148 | (narrow-to-region (point-max) (point-max)) | 145 | (insert-buffer-substring tembuf) |
| 149 | (insert-buffer-substring tembuf) | 146 | (goto-char (point-min)) |
| 150 | (goto-char (point-min)) | 147 | (widen) |
| 151 | (widen) | 148 | (search-backward "\n\^_") |
| 152 | (search-backward "\n\^_") | 149 | (narrow-to-region (point) (point-max)) |
| 153 | (narrow-to-region (point) (point-max)) | 150 | (rmail-count-new-messages t) |
| 154 | (rmail-count-new-messages t) | 151 | (if (rmail-summary-exists) |
| 155 | (if (rmail-summary-exists) | 152 | (rmail-select-summary |
| 156 | (rmail-select-summary | 153 | (rmail-update-summary))) |
| 157 | (rmail-update-summary))) | 154 | (rmail-show-message-1 msg)) |
| 158 | (rmail-show-message-1 msg))) | ||
| 159 | 155 | ||
| 160 | (defun rmail-convert-to-babyl-format () | 156 | (defun rmail-convert-to-babyl-format () |
| 161 | (let ((count 0) (start (point-min)) | 157 | (let ((count 0) (start (point-min)) |
| @@ -306,7 +302,7 @@ Then display message number MSG." | |||
| 306 | t))))))) | 302 | t))))))) |
| 307 | 303 | ||
| 308 | (defun rmail-output-as-mbox (file-name nomsg &optional as-seen) | 304 | (defun rmail-output-as-mbox (file-name nomsg &optional as-seen) |
| 309 | "Convert the current buffer's text to mbox Babyl and output to FILE-NAME. | 305 | "Convert the current buffer's text to mbox and output to FILE-NAME. |
| 310 | It alters the current buffer's text, so call with a temp buffer current. | 306 | It alters the current buffer's text, so call with a temp buffer current. |
| 311 | If FILE-NAME is visited, output into its buffer instead. | 307 | If FILE-NAME is visited, output into its buffer instead. |
| 312 | AS-SEEN is non-nil if we are copying the message \"as seen\"." | 308 | AS-SEEN is non-nil if we are copying the message \"as seen\"." |
| @@ -478,8 +474,9 @@ The optional fourth argument FROM-GNUS is set when called from GNUS." | |||
| 478 | (if (= num-appended 1) "" "s")))))) | 474 | (if (= num-appended 1) "" "s")))))) |
| 479 | (kill-buffer tembuf)))) | 475 | (kill-buffer tembuf)))) |
| 480 | 476 | ||
| 477 | ;; FIXME gnus does not use this function. | ||
| 481 | (defun rmail-output-as-seen (file-name &optional count noattribute from-gnus) | 478 | (defun rmail-output-as-seen (file-name &optional count noattribute from-gnus) |
| 482 | "Append this message to system-inbox-format mail file named FILE-NAME. | 479 | "Append this message to mbox file named FILE-NAME. |
| 483 | A prefix argument COUNT says to output that many consecutive messages, | 480 | A prefix argument COUNT says to output that many consecutive messages, |
| 484 | starting with the current one. Deleted messages are skipped and don't count. | 481 | starting with the current one. Deleted messages are skipped and don't count. |
| 485 | When called from Lisp code, COUNT may be omitted and defaults to 1. | 482 | When called from Lisp code, COUNT may be omitted and defaults to 1. |
| @@ -537,7 +534,7 @@ The optional fourth argument FROM-GNUS is set when called from GNUS." | |||
| 537 | (with-current-buffer tembuf | 534 | (with-current-buffer tembuf |
| 538 | (insert-buffer-substring cur beg end) | 535 | (insert-buffer-substring cur beg end) |
| 539 | ;; Convert the text to one format or another and output. | 536 | ;; Convert the text to one format or another and output. |
| 540 | (rmail-output-as-mbox file-name | 537 | (rmail-output-as-mbox file-name |
| 541 | (if noattribute 'nomsg) | 538 | (if noattribute 'nomsg) |
| 542 | t))))) | 539 | t))))) |
| 543 | 540 | ||