diff options
| author | Richard M. Stallman | 2008-12-29 19:16:37 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2008-12-29 19:16:37 +0000 |
| commit | e1ebab6e8be57647f26adacb5d9ddac801048d39 (patch) | |
| tree | 319f2f2ca1f0d4442d0c52fbef8d7eb3532aba8c | |
| parent | 5921f0a48cc137ff342ddfdd25b3bdec18c0baca (diff) | |
| download | emacs-e1ebab6e8be57647f26adacb5d9ddac801048d39.tar.gz emacs-e1ebab6e8be57647f26adacb5d9ddac801048d39.zip | |
(pmail-forwarded-attr-index): Doc fix.
(pmail-resent-attr-index): New variable.
(pmail-attr-array): Add r for resent.
(pmail-add-mbox-headers): Make 8 attributes.
(pmail-set-attribute): Extend attribute line if necessary.
(pmail-widen): New command.
(pmail-mode-map): o is pmail-output, C-o is pmail-output-as-seen,
(pmail-mode-map): c-w is pmail-widen.
(pmail-change-major-mode-hook): Do nothing unless buffer-swapped-with.
(pmail-show-message): Downcase character-coding.
| -rw-r--r-- | lisp/mail/pmail.el | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/lisp/mail/pmail.el b/lisp/mail/pmail.el index 42ae1cea492..3a43cc0ce90 100644 --- a/lisp/mail/pmail.el +++ b/lisp/mail/pmail.el | |||
| @@ -65,11 +65,14 @@ | |||
| 65 | "The index for the `retried' attribute.") | 65 | "The index for the `retried' attribute.") |
| 66 | 66 | ||
| 67 | (defconst pmail-forwarded-attr-index 5 | 67 | (defconst pmail-forwarded-attr-index 5 |
| 68 | "The index for the `stored' attribute.") | 68 | "The index for the `forwarded' attribute.") |
| 69 | 69 | ||
| 70 | (defconst pmail-unseen-attr-index 6 | 70 | (defconst pmail-unseen-attr-index 6 |
| 71 | "The index for the `unseen' attribute.") | 71 | "The index for the `unseen' attribute.") |
| 72 | 72 | ||
| 73 | (defconst pmail-resent-attr-index 6 | ||
| 74 | "The index for the `resent' attribute.") | ||
| 75 | |||
| 73 | (defconst pmail-attr-array | 76 | (defconst pmail-attr-array |
| 74 | '[(?A "answered") | 77 | '[(?A "answered") |
| 75 | (?D "deleted") | 78 | (?D "deleted") |
| @@ -77,7 +80,8 @@ | |||
| 77 | (?F "filed") | 80 | (?F "filed") |
| 78 | (?R "retried") | 81 | (?R "retried") |
| 79 | (?S "forwarded") | 82 | (?S "forwarded") |
| 80 | (?U "unseen")] | 83 | (?U "unseen") |
| 84 | (?r "resent")] | ||
| 81 | "An array that provides a mapping between an attribute index, | 85 | "An array that provides a mapping between an attribute index, |
| 82 | its character representation and its display representation.") | 86 | its character representation and its display representation.") |
| 83 | 87 | ||
| @@ -986,8 +990,8 @@ The buffer is expected to be narrowed to just the header of the message." | |||
| 986 | (define-key pmail-mode-map "n" 'pmail-next-undeleted-message) | 990 | (define-key pmail-mode-map "n" 'pmail-next-undeleted-message) |
| 987 | (define-key pmail-mode-map "\en" 'pmail-next-message) | 991 | (define-key pmail-mode-map "\en" 'pmail-next-message) |
| 988 | (define-key pmail-mode-map "\e\C-n" 'pmail-next-labeled-message) | 992 | (define-key pmail-mode-map "\e\C-n" 'pmail-next-labeled-message) |
| 989 | (define-key pmail-mode-map "o" 'pmail-output-to-babyl-file) | 993 | (define-key pmail-mode-map "o" 'pmail-output) |
| 990 | (define-key pmail-mode-map "\C-o" 'pmail-output) | 994 | (define-key pmail-mode-map "\C-o" 'pmail-output-as-seen) |
| 991 | (define-key pmail-mode-map "p" 'pmail-previous-undeleted-message) | 995 | (define-key pmail-mode-map "p" 'pmail-previous-undeleted-message) |
| 992 | (define-key pmail-mode-map "\ep" 'pmail-previous-message) | 996 | (define-key pmail-mode-map "\ep" 'pmail-previous-message) |
| 993 | (define-key pmail-mode-map "\e\C-p" 'pmail-previous-labeled-message) | 997 | (define-key pmail-mode-map "\e\C-p" 'pmail-previous-labeled-message) |
| @@ -1000,6 +1004,7 @@ The buffer is expected to be narrowed to just the header of the message." | |||
| 1000 | (define-key pmail-mode-map "t" 'pmail-toggle-header) | 1004 | (define-key pmail-mode-map "t" 'pmail-toggle-header) |
| 1001 | (define-key pmail-mode-map "u" 'pmail-undelete-previous-message) | 1005 | (define-key pmail-mode-map "u" 'pmail-undelete-previous-message) |
| 1002 | (define-key pmail-mode-map "w" 'pmail-output-body-to-file) | 1006 | (define-key pmail-mode-map "w" 'pmail-output-body-to-file) |
| 1007 | (define-key pmail-mode-map "C-w" 'pmail-widen) | ||
| 1003 | (define-key pmail-mode-map "x" 'pmail-expunge) | 1008 | (define-key pmail-mode-map "x" 'pmail-expunge) |
| 1004 | (define-key pmail-mode-map "." 'pmail-beginning-of-message) | 1009 | (define-key pmail-mode-map "." 'pmail-beginning-of-message) |
| 1005 | (define-key pmail-mode-map "/" 'pmail-end-of-message) | 1010 | (define-key pmail-mode-map "/" 'pmail-end-of-message) |
| @@ -1276,9 +1281,10 @@ Create the buffer if necessary." | |||
| 1276 | 1281 | ||
| 1277 | (defun pmail-change-major-mode-hook () | 1282 | (defun pmail-change-major-mode-hook () |
| 1278 | ;; Bring the actual Pmail messages back into the main buffer. | 1283 | ;; Bring the actual Pmail messages back into the main buffer. |
| 1279 | (when (pmail-buffers-swapped-p) | 1284 | (if buffer-swapped-with |
| 1280 | (setq buffer-swapped-with nil) | 1285 | (when (pmail-buffers-swapped-p) |
| 1281 | (buffer-swap-text pmail-view-buffer))) | 1286 | (setq buffer-swapped-with nil) |
| 1287 | (buffer-swap-text pmail-view-buffer)))) | ||
| 1282 | ;; Throw away the summary. | 1288 | ;; Throw away the summary. |
| 1283 | ;;(when (buffer-live-p pmail-view-buffer) (kill-buffer pmail-view-buffer))) | 1289 | ;;(when (buffer-live-p pmail-view-buffer) (kill-buffer pmail-view-buffer))) |
| 1284 | 1290 | ||
| @@ -1930,7 +1936,7 @@ new messages. Return the number of new messages." | |||
| 1930 | (save-restriction | 1936 | (save-restriction |
| 1931 | (let ((count 0) | 1937 | (let ((count 0) |
| 1932 | (start (point)) | 1938 | (start (point)) |
| 1933 | (value "------U") | 1939 | (value "------U-") |
| 1934 | limit) | 1940 | limit) |
| 1935 | ;; Detect an empty inbox file. | 1941 | ;; Detect an empty inbox file. |
| 1936 | (unless (= start (point-max)) | 1942 | (unless (= start (point-max)) |
| @@ -2145,13 +2151,22 @@ change; nil means current message." | |||
| 2145 | (if (search-forward (concat pmail-attribute-header ": ") limit t) | 2151 | (if (search-forward (concat pmail-attribute-header ": ") limit t) |
| 2146 | ;; If this message already records attributes, | 2152 | ;; If this message already records attributes, |
| 2147 | ;; just change the value for this one. | 2153 | ;; just change the value for this one. |
| 2148 | (progn (forward-char attr) | 2154 | (let ((missing (- (+ (point) attr) (line-end-position)))) |
| 2149 | (when (/= value (char-after)) | 2155 | ;; Position point at this attribute, |
| 2150 | (delete-char 1) | 2156 | ;; adding attributes if necessary. |
| 2151 | (insert value))) | 2157 | (if (> missing 0) |
| 2158 | (progn | ||
| 2159 | (end-of-line) | ||
| 2160 | (insert-char ?- missing) | ||
| 2161 | (backward-char 1)) | ||
| 2162 | (forward-char attr)) | ||
| 2163 | ;; Change this attribute. | ||
| 2164 | (when (/= value (char-after)) | ||
| 2165 | (delete-char 1) | ||
| 2166 | (insert value))) | ||
| 2152 | ;; Otherwise add a header line to record the attributes | 2167 | ;; Otherwise add a header line to record the attributes |
| 2153 | ;; and set all but this one to nil. | 2168 | ;; and set all but this one to no. |
| 2154 | (let ((header-value "-------")) | 2169 | (let ((header-value "--------")) |
| 2155 | (aset header-value attr value) | 2170 | (aset header-value attr value) |
| 2156 | (goto-char (if limit (- limit 1) (point-max))) | 2171 | (goto-char (if limit (- limit 1) (point-max))) |
| 2157 | (insert pmail-attribute-header ": " header-value "\n")))))) | 2172 | (insert pmail-attribute-header ": " header-value "\n")))))) |
| @@ -2441,6 +2456,12 @@ If so restore the actual mbox message collection." | |||
| 2441 | (buffer-swap-text pmail-view-buffer) | 2456 | (buffer-swap-text pmail-view-buffer) |
| 2442 | (setq buffer-swapped-with nil)))) | 2457 | (setq buffer-swapped-with nil)))) |
| 2443 | 2458 | ||
| 2459 | (defun pmail-widen () | ||
| 2460 | "Display the entire mailbox file." | ||
| 2461 | (interactive) | ||
| 2462 | (pmail-swap-buffers-maybe) | ||
| 2463 | (widen)) | ||
| 2464 | |||
| 2444 | (defun pmail-show-message-maybe (&optional n no-summary) | 2465 | (defun pmail-show-message-maybe (&optional n no-summary) |
| 2445 | "Show message number N (prefix argument), counting from start of file. | 2466 | "Show message number N (prefix argument), counting from start of file. |
| 2446 | If summary buffer is currently displayed, update current message there also." | 2467 | If summary buffer is currently displayed, update current message there also." |
| @@ -2521,6 +2542,8 @@ The current mail message becomes the message displayed." | |||
| 2521 | (setq character-coding (mail-fetch-field "content-transfer-encoding") | 2542 | (setq character-coding (mail-fetch-field "content-transfer-encoding") |
| 2522 | is-text-message (pmail-is-text-p) | 2543 | is-text-message (pmail-is-text-p) |
| 2523 | coding-system (pmail-get-coding-system)) | 2544 | coding-system (pmail-get-coding-system)) |
| 2545 | (if character-coding | ||
| 2546 | (setq character-coding (downcase character-coding))) | ||
| 2524 | (widen) | 2547 | (widen) |
| 2525 | (narrow-to-region beg end) | 2548 | (narrow-to-region beg end) |
| 2526 | ;; Decode the message body into an empty view buffer using a | 2549 | ;; Decode the message body into an empty view buffer using a |