Mercurial > emacs
annotate lisp/mail/pmailsum.el @ 101011:04548ca9af08
Replace last-input-char with last-input-event.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Fri, 09 Jan 2009 04:55:50 +0000 |
parents | 50cbf7fa2d88 |
children | 490b85e0b4fc |
rev | line source |
---|---|
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1 ;;; pmailsum.el --- make summary buffers for the mail reader |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
2 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
3 ;; Copyright (C) 1985, 1993, 1994, 1995, 1996, 2000, 2001, 2002, 2003, |
100908 | 4 ;; 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
5 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
6 ;; Maintainer: FSF |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
7 ;; Keywords: mail |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
8 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
10 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
14 ;; (at your option) any later version. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
15 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
19 ;; GNU General Public License for more details. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
20 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
23 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
24 ;;; Commentary: |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
25 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
26 ;; Extended by Bob Weiner of Motorola |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
27 ;; Provided all commands from pmail-mode in pmail-summary-mode and made key |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
28 ;; bindings in both modes wholly compatible. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
29 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
30 ;;; Code: |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
31 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
32 (defvar msgnum) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
33 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
34 ;; For pmail-select-summary |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
35 (require 'pmail) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
36 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
37 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
38 (defcustom pmail-summary-scroll-between-messages t |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
39 "*Non-nil means Pmail summary scroll commands move between messages." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
40 :type 'boolean |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
41 :group 'pmail-summary) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
42 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
43 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
44 (defcustom pmail-summary-line-count-flag t |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
45 "*Non-nil means Pmail summary should show the number of lines in each message." |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
46 :type 'boolean |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
47 :group 'pmail-summary) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
48 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
49 (defvar pmail-summary-font-lock-keywords |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
50 '(("^.....D.*" . font-lock-string-face) ; Deleted. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
51 ("^.....-.*" . font-lock-type-face) ; Unread. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
52 ;; Neither of the below will be highlighted if either of the above are: |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
53 ("^.....[^D-] \\(......\\)" 1 font-lock-keyword-face) ; Date. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
54 ("{ \\([^\n}]+\\) }" 1 font-lock-comment-face)) ; Labels. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
55 "Additional expressions to highlight in Pmail Summary mode.") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
56 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
57 (defvar pmail-summary-redo |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
58 "(FUNCTION . ARGS) to regenerate this Pmail summary buffer.") |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
59 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
60 (defvar pmail-summary-overlay nil) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
61 (put 'pmail-summary-overlay 'permanent-local t) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
62 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
63 (defvar pmail-summary-mode-map nil) |
97808
1aab9bdd9355
Resolve all byte compiler warnings and enable IMAP/movemail support.
Paul Reilly <pmr@pajato.com>
parents:
97533
diff
changeset
|
64 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
65 ;; Entry points for making a summary buffer. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
66 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
67 ;; Regenerate the contents of the summary |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
68 ;; using the same selection criterion as last time. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
69 ;; M-x revert-buffer in a summary buffer calls this function. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
70 (defun pmail-update-summary (&rest ignore) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
71 (apply (car pmail-summary-redo) (cdr pmail-summary-redo))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
72 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
73 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
74 (defun pmail-summary () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
75 "Display a summary of all messages, one line per message." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
76 (interactive) |
100128
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
77 (pmail-new-summary "All" '(pmail-summary) nil) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
78 (unless (get-buffer-window pmail-buffer) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
79 (pmail-summary-beginning-of-message))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
80 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
81 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
82 (defun pmail-summary-by-labels (labels) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
83 "Display a summary of all messages with one or more LABELS. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
84 LABELS should be a string containing the desired labels, separated by commas." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
85 (interactive "sLabels to summarize by: ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
86 (if (string= labels "") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
87 (setq labels (or pmail-last-multi-labels |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
88 (error "No label specified")))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
89 (setq pmail-last-multi-labels labels) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
90 (pmail-new-summary (concat "labels " labels) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
91 (list 'pmail-summary-by-labels labels) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
92 'pmail-message-labels-p |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
93 (concat ", \\(" (mail-comma-list-regexp labels) "\\),"))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
94 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
95 ;; Return t if the attributes/keywords line of msg number MSG |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
96 ;; contains a match for the regexp LABELS. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
97 (defun pmail-message-labels-p (msg labels) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
98 (string-match labels (pmail-get-labels msg))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
99 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
100 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
101 (defun pmail-summary-by-recipients (recipients &optional primary-only) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
102 "Display a summary of all messages with the given RECIPIENTS. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
103 Normally checks the To, From and Cc fields of headers; |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
104 but if PRIMARY-ONLY is non-nil (prefix arg given), |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
105 only look in the To and From fields. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
106 RECIPIENTS is a string of regexps separated by commas." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
107 (interactive "sRecipients to summarize by: \nP") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
108 (pmail-new-summary |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
109 (concat "recipients " recipients) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
110 (list 'pmail-summary-by-recipients recipients primary-only) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
111 'pmail-message-recipients-p |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
112 (mail-comma-list-regexp recipients) primary-only)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
113 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
114 (defun pmail-message-recipients-p (msg recipients &optional primary-only) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
115 (pmail-apply-in-message msg 'pmail-message-recipients-p-1 |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
116 recipients primary-only)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
117 |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
118 (defun pmail-message-recipients-p-1 (recipients &optional primary-only) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
119 (narrow-to-region (point) (progn (search-forward "\n\n") (point))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
120 (or (string-match recipients (or (mail-fetch-field "To") "")) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
121 (string-match recipients (or (mail-fetch-field "From") "")) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
122 (if (not primary-only) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
123 (string-match recipients (or (mail-fetch-field "Cc") ""))))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
124 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
125 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
126 (defun pmail-summary-by-regexp (regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
127 "Display a summary of all messages according to regexp REGEXP. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
128 If the regular expression is found in the header of the message |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
129 \(including in the date and other lines, as well as the subject line), |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
130 Emacs will list the header line in the PMAIL-summary." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
131 (interactive "sRegexp to summarize by: ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
132 (if (string= regexp "") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
133 (setq regexp (or pmail-last-regexp |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
134 (error "No regexp specified")))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
135 (setq pmail-last-regexp regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
136 (pmail-new-summary (concat "regexp " regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
137 (list 'pmail-summary-by-regexp regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
138 'pmail-message-regexp-p |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
139 regexp)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
140 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
141 (defun pmail-message-regexp-p (msg regexp) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
142 "Return t, if for message number MSG, regexp REGEXP matches in the header." |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
143 (pmail-apply-in-message msg 'pmail-message-regexp-p-1 msg regexp)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
144 |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
145 (defun pmail-message-regexp-p-1 (msg regexp) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
146 (narrow-to-region (point) (progn (search-forward "\n\n") (point))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
147 (if pmail-enable-mime |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
148 (funcall pmail-search-mime-header-function msg regexp (point)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
149 (re-search-forward regexp nil t))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
150 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
151 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
152 (defun pmail-summary-by-topic (subject &optional whole-message) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
153 "Display a summary of all messages with the given SUBJECT. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
154 Normally checks the Subject field of headers; |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
155 but if WHOLE-MESSAGE is non-nil (prefix arg given), |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
156 look in the whole message. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
157 SUBJECT is a string of regexps separated by commas." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
158 (interactive |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
159 (let* ((subject (pmail-simplified-subject)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
160 (prompt (concat "Topics to summarize by (regexp" |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
161 (if subject ", default current subject" "") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
162 "): "))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
163 (list (read-string prompt nil nil subject) current-prefix-arg))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
164 (pmail-new-summary |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
165 (concat "about " subject) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
166 (list 'pmail-summary-by-topic subject whole-message) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
167 'pmail-message-subject-p |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
168 (mail-comma-list-regexp subject) whole-message)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
169 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
170 (defun pmail-message-subject-p (msg subject &optional whole-message) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
171 (if whole-message |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
172 (pmail-apply-in-message msg 're-search-forward subject nil t) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
173 (string-match subject (pmail-simplified-subject msg)))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
174 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
175 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
176 (defun pmail-summary-by-senders (senders) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
177 "Display a summary of all messages with the given SENDERS. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
178 SENDERS is a string of names separated by commas." |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
179 (interactive "sSenders to summarize by: ") |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
180 (pmail-new-summary |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
181 (concat "senders " senders) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
182 (list 'pmail-summary-by-senders senders) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
183 'pmail-message-senders-p |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
184 (mail-comma-list-regexp senders))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
185 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
186 (defun pmail-message-senders-p (msg senders) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
187 (string-match senders (or (pmail-get-header "From" msg) ""))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
188 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
189 ;; General making of a summary buffer. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
190 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
191 (defvar pmail-summary-symbol-number 0) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
192 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
193 (defvar pmail-new-summary-line-count) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
194 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
195 (defun pmail-new-summary (desc redo func &rest args) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
196 "Create a summary of selected messages. |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
197 DESC makes part of the mode line of the summary buffer. REDO is form ... |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
198 For each message, FUNC is applied to the message number and ARGS... |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
199 and if the result is non-nil, that message is included. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
200 nil for FUNCTION means all messages." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
201 (message "Computing summary lines...") |
100128
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
202 (unless pmail-buffer |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
203 (error "No PMAIL buffer found")) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
204 (let (mesg was-in-summary) |
100128
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
205 (if (eq major-mode 'pmail-summary-mode) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
206 (setq was-in-summary t)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
207 (with-current-buffer pmail-buffer |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
208 (setq mesg pmail-current-message |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
209 pmail-summary-buffer (pmail-new-summary-1 desc redo func args))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
210 ;; Now display the summary buffer and go to the right place in it. |
100128
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
211 (unless was-in-summary |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
212 (if (and (one-window-p) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
213 pop-up-windows |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
214 (not pop-up-frames)) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
215 ;; If there is just one window, put the summary on the top. |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
216 (progn |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
217 (split-window (selected-window) pmail-summary-window-size) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
218 (select-window (next-window (frame-first-window))) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
219 (pop-to-buffer pmail-summary-buffer) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
220 ;; If pop-to-buffer did not use that window, delete that |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
221 ;; window. (This can happen if it uses another frame.) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
222 (if (not (eq pmail-summary-buffer |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
223 (window-buffer (frame-first-window)))) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
224 (delete-other-windows))) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
225 (pop-to-buffer pmail-summary-buffer)) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
226 (set-buffer pmail-buffer) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
227 ;; This is how pmail makes the summary buffer reappear. |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
228 ;; We do this here to make the window the proper size. |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
229 (pmail-select-summary nil) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
230 (set-buffer pmail-summary-buffer)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
231 (pmail-summary-goto-msg mesg t t) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
232 (pmail-summary-construct-io-menu) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
233 (message "Computing summary lines...done"))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
234 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
235 (defun pmail-new-summary-1 (description form function args) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
236 "Filter messages to obtain summary lines. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
237 DESCRIPTION is added to the mode line. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
238 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
239 Return the summary buffer by invoking FUNCTION on each message |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
240 passing the message number and ARGS... |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
241 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
242 REDO is a form ... |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
243 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
244 The current buffer must be a Pmail buffer either containing a |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
245 collection of mbox formatted messages or displaying a single |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
246 message." |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
247 (let ((summary-msgs ()) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
248 (pmail-new-summary-line-count 0) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
249 (sumbuf (pmail-get-create-summary-buffer))) |
100655
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
250 ;; Scan the messages, getting their summary strings |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
251 ;; and putting the list of them in SUMMARY-MSGS. |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
252 (let ((msgnum 1) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
253 (main-buffer (current-buffer)) |
100655
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
254 (total pmail-total-messages) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
255 (inhibit-read-only t)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
256 (save-excursion |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
257 ;; Go where the mbox text is. |
100655
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
258 (if (pmail-buffers-swapped-p) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
259 (set-buffer pmail-view-buffer)) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
260 (let ((old-min (point-min-marker)) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
261 (old-max (point-max-marker))) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
262 (unwind-protect |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
263 ;; Can't use save-restriction here; that doesn't work if we |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
264 ;; plan to modify text outside the original restriction. |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
265 (save-excursion |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
266 (widen) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
267 (goto-char (point-min)) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
268 (while (>= total msgnum) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
269 ;; Go back to the Pmail buffer so |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
270 ;; so FUNCTION and pmail-get-summary can see its local vars. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
271 (with-current-buffer main-buffer |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
272 ;; First test whether to include this message. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
273 (if (or (null function) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
274 (apply function msgnum args)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
275 (setq summary-msgs |
100655
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
276 (cons (cons msgnum (pmail-get-summary msgnum)) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
277 summary-msgs)))) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
278 (setq msgnum (1+ msgnum)) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
279 ;; Provide a periodic User progress message. |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
280 (if (zerop (% pmail-new-summary-line-count 10)) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
281 (message "Computing summary lines...%d" |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
282 pmail-new-summary-line-count))) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
283 (setq summary-msgs (nreverse summary-msgs))) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
284 (narrow-to-region old-min old-max))))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
285 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
286 ;; Temporarily, while summary buffer is unfinished, |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
287 ;; we "don't have" a summary. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
288 ;; |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
289 ;; I have not a clue what this clause is doing. If you read this |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
290 ;; chunk of code and have a clue, then please email that clue to |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
291 ;; pmr@pajato.com |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
292 (setq pmail-summary-buffer nil) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
293 (if pmail-enable-mime |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
294 (with-current-buffer pmail-buffer |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
295 (setq pmail-summary-buffer nil))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
296 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
297 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
298 (let ((rbuf (current-buffer)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
299 (total pmail-total-messages)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
300 (set-buffer sumbuf) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
301 ;; Set up the summary buffer's contents. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
302 (let ((buffer-read-only nil)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
303 (erase-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
304 (while summary-msgs |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
305 (princ (cdr (car summary-msgs)) sumbuf) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
306 (setq summary-msgs (cdr summary-msgs))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
307 (goto-char (point-min))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
308 ;; Set up the rest of its state and local variables. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
309 (setq buffer-read-only t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
310 (pmail-summary-mode) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
311 (make-local-variable 'minor-mode-alist) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
312 (setq minor-mode-alist (list (list t (concat ": " description)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
313 (setq pmail-buffer rbuf |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
314 pmail-summary-redo form |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
315 pmail-total-messages total))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
316 sumbuf)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
317 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
318 (defun pmail-get-create-summary-buffer () |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
319 "Obtain a summary buffer by re-using an existing summary |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
320 buffer, or by creating a new summary buffer." |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
321 (if (and pmail-summary-buffer (buffer-name pmail-summary-buffer)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
322 pmail-summary-buffer |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
323 (generate-new-buffer (concat (buffer-name) "-summary")))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
324 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
325 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
326 ;; Low levels of generating a summary. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
327 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
328 (defun pmail-get-summary (msgnum) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
329 "Return the summary line for message MSGNUM. |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
330 The mbox buffer must be current when you call this function |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
331 even if its text is swapped. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
332 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
333 If the message has a summary line already, it will be stored in |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
334 the message as a header and simply returned, otherwise the |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
335 summary line is created, saved in the message header, cached and |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
336 returned. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
337 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
338 The current buffer contains the unrestricted message collection." |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
339 (let ((line (aref pmail-summary-vector (1- msgnum)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
340 (unless line |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
341 ;; Register a summary line for MSGNUM. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
342 (setq pmail-new-summary-line-count (1+ pmail-new-summary-line-count) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
343 line (pmail-create-summary-line msgnum)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
344 ;; Cache the summary line for use during this Pmail session. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
345 (aset pmail-summary-vector (1- msgnum) line)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
346 line)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
347 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
348 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
349 (defcustom pmail-summary-line-decoder (function identity) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
350 "*Function to decode a Pmail summary line. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
351 It receives the summary line for one message as a string |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
352 and should return the decoded string. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
353 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
354 By default, it is `identity', which returns the string unaltered." |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
355 :type 'function |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
356 :group 'pmail-summary) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
357 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
358 (defun pmail-create-summary-line (msgnum) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
359 "Return the summary line for message MSGNUM. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
360 Obtain the message summary from the header if it is available |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
361 otherwise create it and store it in the message header. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
362 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
363 The mbox buffer must be current when you call this function |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
364 even if its text is swapped." |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
365 (let ((beg (pmail-msgbeg msgnum)) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
366 (end (pmail-msgend msgnum)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
367 (deleted (pmail-message-deleted-p msgnum)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
368 (unseen (pmail-message-unseen-p msgnum)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
369 lines) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
370 (save-excursion |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
371 ;; Switch to the buffer that has the whole mbox text. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
372 (if (pmail-buffers-swapped-p) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
373 (set-buffer pmail-view-buffer)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
374 ;; Now we can compute the line count. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
375 (if pmail-summary-line-count-flag |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
376 (setq lines (count-lines beg end))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
377 |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
378 ;; Narrow to the message header. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
379 (save-excursion |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
380 (goto-char beg) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
381 (if (search-forward "\n\n" end t) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
382 (save-restriction |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
383 (narrow-to-region beg (point)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
384 ;; Generate a status line from the message. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
385 (pmail-create-summary msgnum deleted unseen lines)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
386 (pmail-error-bad-format msgnum)))))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
387 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
388 (defun pmail-get-summary-labels () |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
389 "Return a coded string wrapped in curly braces denoting the status labels. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
390 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
391 The current buffer must already be narrowed to the message headers for |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
392 the message being processed." |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
393 (let ((status (mail-fetch-field pmail-attribute-header)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
394 (index 0) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
395 (result "") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
396 char) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
397 ;; Strip off the read/unread and the deleted attribute which are |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
398 ;; handled separately. |
100120
47671319c860
(pmail-get-summary-labels): If no attribute headers are found, use the
Chong Yidong <cyd@stupidchicken.com>
parents:
98526
diff
changeset
|
399 (setq status |
47671319c860
(pmail-get-summary-labels): If no attribute headers are found, use the
Chong Yidong <cyd@stupidchicken.com>
parents:
98526
diff
changeset
|
400 (if status |
47671319c860
(pmail-get-summary-labels): If no attribute headers are found, use the
Chong Yidong <cyd@stupidchicken.com>
parents:
98526
diff
changeset
|
401 (concat (substring status 0 1) (substring status 2 6)) |
47671319c860
(pmail-get-summary-labels): If no attribute headers are found, use the
Chong Yidong <cyd@stupidchicken.com>
parents:
98526
diff
changeset
|
402 "")) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
403 (while (< index (length status)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
404 (unless (string= "-" (setq char (substring status index (1+ index)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
405 (setq result (concat result char))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
406 (setq index (1+ index))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
407 (when (> (length result) 0) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
408 (setq result (concat "{" result "}"))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
409 result)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
410 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
411 (defun pmail-create-summary (msgnum deleted unseen lines) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
412 "Return the summary line for message MSGNUM. |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
413 The current buffer should already be narrowed to the header for that message. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
414 It could be either buffer, so don't access Pmail local variables. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
415 DELETED is t if this message is marked deleted. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
416 UNSEEN is t if it is marked unseen. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
417 LINES is the number of lines in the message (if we should display that) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
418 or else nil." |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
419 (goto-char (point-min)) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
420 (let ((line (pmail-header-summary)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
421 (labels (pmail-get-summary-labels)) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
422 pos status prefix basic-start basic-end linecount-string) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
423 |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
424 (setq linecount-string |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
425 (cond |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
426 ((not lines) " ") |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
427 ((<= lines 9) (format " [%d]" lines)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
428 ((<= lines 99) (format " [%d]" lines)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
429 ((<= lines 999) (format " [%d]" lines)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
430 ((<= lines 9999) (format " [%dk]" (/ lines 1000))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
431 ((<= lines 99999) (format " [%dk]" (/ lines 1000))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
432 (t (format "[%dk]" (/ lines 1000))))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
433 |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
434 (setq status (cond |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
435 (deleted ?D) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
436 (unseen ?-) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
437 (t ? )) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
438 prefix (format "%5d%c" msgnum status) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
439 basic-start (car line) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
440 basic-end (cadr line)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
441 (funcall pmail-summary-line-decoder |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
442 (concat prefix basic-start linecount-string " " |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
443 labels basic-end)))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
444 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
445 ;;;###autoload |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
446 (defcustom pmail-user-mail-address-regexp nil |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
447 "*Regexp matching user mail addresses. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
448 If non-nil, this variable is used to identify the correspondent |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
449 when receiving new mail. If it matches the address of the sender, |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
450 the recipient is taken as correspondent of a mail. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
451 If nil \(default value\), your `user-login-name' and `user-mail-address' |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
452 are used to exclude yourself as correspondent. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
453 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
454 Usually you don't have to set this variable, except if you collect mails |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
455 sent by you under different user names. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
456 Then it should be a regexp matching your mail addresses. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
457 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
458 Setting this variable has an effect only before reading a mail." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
459 :type '(choice (const :tag "None" nil) regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
460 :group 'pmail-retrieve |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
461 :version "21.1") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
462 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
463 (defun pmail-header-summary () |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
464 "Return a message summary based on the message headers. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
465 The value is a list of two strings, the first and second parts of the summary. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
466 |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
467 The current buffer must already be narrowed to the message headers for |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
468 the message being processed." |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
469 (goto-char (point-min)) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
470 (list |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
471 (concat (save-excursion |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
472 (if (not (re-search-forward "^Date:" nil t)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
473 " " |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
474 (cond ((re-search-forward "\\([^0-9:]\\)\\([0-3]?[0-9]\\)\\([- \t_]+\\)\\([adfjmnos][aceopu][bcglnprtvy]\\)" |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
475 (save-excursion (end-of-line) (point)) t) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
476 (format "%2d-%3s" |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
477 (string-to-number (buffer-substring |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
478 (match-beginning 2) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
479 (match-end 2))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
480 (buffer-substring |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
481 (match-beginning 4) (match-end 4)))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
482 ((re-search-forward "\\([^a-z]\\)\\([adfjmnos][acepou][bcglnprtvy]\\)\\([-a-z \t_]*\\)\\([0-9][0-9]?\\)" |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
483 (save-excursion (end-of-line) (point)) t) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
484 (format "%2d-%3s" |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
485 (string-to-number (buffer-substring |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
486 (match-beginning 4) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
487 (match-end 4))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
488 (buffer-substring |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
489 (match-beginning 2) (match-end 2)))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
490 ((re-search-forward "\\(19\\|20\\)\\([0-9][0-9]\\)-\\([01][0-9]\\)-\\([0-3][0-9]\\)" |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
491 (save-excursion (end-of-line) (point)) t) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
492 (format "%2s%2s%2s" |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
493 (buffer-substring |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
494 (match-beginning 2) (match-end 2)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
495 (buffer-substring |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
496 (match-beginning 3) (match-end 3)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
497 (buffer-substring |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
498 (match-beginning 4) (match-end 4)))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
499 (t "??????")))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
500 " " |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
501 (save-excursion |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
502 (let* ((from (and (re-search-forward "^From:[ \t]*" nil t) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
503 (mail-strip-quoted-names |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
504 (buffer-substring |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
505 (1- (point)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
506 ;; Get all the lines of the From field |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
507 ;; so that we get a whole comment if there is one, |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
508 ;; so that mail-strip-quoted-names can discard it. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
509 (let ((opoint (point))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
510 (while (progn (forward-line 1) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
511 (looking-at "[ \t]"))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
512 ;; Back up over newline, then trailing spaces or tabs |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
513 (forward-char -1) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
514 (skip-chars-backward " \t") |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
515 (point)))))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
516 len mch lo) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
517 (if (or (null from) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
518 (string-match |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
519 (or pmail-user-mail-address-regexp |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
520 (concat "^\\(" |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
521 (regexp-quote (user-login-name)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
522 "\\($\\|@\\)\\|" |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
523 (regexp-quote |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
524 ;; Don't lose if run from init file |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
525 ;; where user-mail-address is not |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
526 ;; set yet. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
527 (or user-mail-address |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
528 (concat (user-login-name) "@" |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
529 (or mail-host-address |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
530 (system-name))))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
531 "\\>\\)")) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
532 from)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
533 ;; No From field, or it's this user. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
534 (save-excursion |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
535 (goto-char (point-min)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
536 (if (not (re-search-forward "^To:[ \t]*" nil t)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
537 nil |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
538 (setq from |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
539 (concat "to: " |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
540 (mail-strip-quoted-names |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
541 (buffer-substring |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
542 (point) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
543 (progn (end-of-line) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
544 (skip-chars-backward " \t") |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
545 (point))))))))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
546 (if (null from) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
547 " " |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
548 (setq len (length from)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
549 (setq mch (string-match "[@%]" from)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
550 (format "%25s" |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
551 (if (or (not mch) (<= len 25)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
552 (substring from (max 0 (- len 25))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
553 (substring from |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
554 (setq lo (cond ((< (- mch 14) 0) 0) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
555 ((< len (+ mch 11)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
556 (- len 25)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
557 (t (- mch 14)))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
558 (min len (+ lo 25))))))))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
559 (concat (if (re-search-forward "^Subject:" nil t) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
560 (progn (skip-chars-forward " \t") |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
561 (buffer-substring (point) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
562 (progn (end-of-line) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
563 (point)))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
564 (re-search-forward "[\n][\n]+" nil t) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
565 (buffer-substring (point) (progn (end-of-line) (point)))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
566 "\n"))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
567 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
568 ;; Simple motion in a summary buffer. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
569 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
570 (defun pmail-summary-next-all (&optional number) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
571 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
572 (forward-line (if number number 1)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
573 ;; It doesn't look nice to move forward past the last message line. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
574 (and (eobp) (> number 0) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
575 (forward-line -1)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
576 (display-buffer pmail-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
577 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
578 (defun pmail-summary-previous-all (&optional number) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
579 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
580 (forward-line (- (if number number 1))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
581 ;; It doesn't look nice to move forward past the last message line. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
582 (and (eobp) (< number 0) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
583 (forward-line -1)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
584 (display-buffer pmail-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
585 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
586 (defun pmail-summary-next-msg (&optional number) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
587 "Display next non-deleted msg from pmail file. |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
588 With optional prefix argument NUMBER, moves forward this number of non-deleted |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
589 messages, or backward if NUMBER is negative." |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
590 (interactive "p") |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
591 (forward-line 0) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
592 (and (> number 0) (end-of-line)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
593 (let ((count (if (< number 0) (- number) number)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
594 (search (if (> number 0) 're-search-forward 're-search-backward)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
595 (non-del-msg-found nil)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
596 (while (and (> count 0) (setq non-del-msg-found |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
597 (or (funcall search "^.....[^D]" nil t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
598 non-del-msg-found))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
599 (setq count (1- count)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
600 (beginning-of-line) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
601 (display-buffer pmail-buffer)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
602 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
603 (defun pmail-summary-previous-msg (&optional number) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
604 "Display previous non-deleted msg from pmail file. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
605 With optional prefix argument NUMBER, moves backward this number of |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
606 non-deleted messages." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
607 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
608 (pmail-summary-next-msg (- (if number number 1)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
609 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
610 (defun pmail-summary-next-labeled-message (n labels) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
611 "Show next message with LABELS. Defaults to last labels used. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
612 With prefix argument N moves forward N messages with these labels." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
613 (interactive "p\nsMove to next msg with labels: ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
614 (let (msg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
615 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
616 (set-buffer pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
617 (pmail-next-labeled-message n labels) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
618 (setq msg pmail-current-message)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
619 (pmail-summary-goto-msg msg))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
620 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
621 (defun pmail-summary-previous-labeled-message (n labels) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
622 "Show previous message with LABELS. Defaults to last labels used. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
623 With prefix argument N moves backward N messages with these labels." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
624 (interactive "p\nsMove to previous msg with labels: ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
625 (let (msg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
626 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
627 (set-buffer pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
628 (pmail-previous-labeled-message n labels) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
629 (setq msg pmail-current-message)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
630 (pmail-summary-goto-msg msg))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
631 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
632 (defun pmail-summary-next-same-subject (n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
633 "Go to the next message in the summary having the same subject. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
634 With prefix argument N, do this N times. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
635 If N is negative, go backwards." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
636 (interactive "p") |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
637 (let ((forward (> n 0)) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
638 subject i found) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
639 (with-current-buffer pmail-buffer |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
640 (setq subject (pmail-simplified-subject) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
641 i pmail-current-message)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
642 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
643 (while (and (/= n 0) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
644 (if forward |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
645 (not (eobp)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
646 (not (bobp)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
647 (let (done) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
648 (while (and (not done) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
649 (if forward |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
650 (not (eobp)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
651 (not (bobp)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
652 ;; Advance thru summary. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
653 (forward-line (if forward 1 -1)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
654 ;; Get msg number of this line. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
655 (setq i (string-to-number |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
656 (buffer-substring (point) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
657 (min (point-max) (+ 6 (point)))))) |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
658 (setq done (string-equal subject (pmail-simplified-subject i)))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
659 (if done (setq found i))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
660 (setq n (if forward (1- n) (1+ n))))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
661 (if found |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
662 (pmail-summary-goto-msg found) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
663 (error "No %s message with same subject" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
664 (if forward "following" "previous"))))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
665 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
666 (defun pmail-summary-previous-same-subject (n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
667 "Go to the previous message in the summary having the same subject. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
668 With prefix argument N, do this N times. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
669 If N is negative, go forwards instead." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
670 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
671 (pmail-summary-next-same-subject (- n))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
672 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
673 ;; Delete and undelete summary commands. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
674 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
675 (defun pmail-summary-delete-forward (&optional count) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
676 "Delete this message and move to next nondeleted one. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
677 Deleted messages stay in the file until the \\[pmail-expunge] command is given. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
678 A prefix argument serves as a repeat count; |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
679 a negative argument means to delete and move backward." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
680 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
681 (unless (numberp count) (setq count 1)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
682 (let (end del-msg |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
683 (backward (< count 0))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
684 (while (/= count 0) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
685 (pmail-summary-goto-msg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
686 (with-current-buffer pmail-buffer |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
687 (pmail-delete-message) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
688 (setq del-msg pmail-current-message)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
689 (pmail-summary-mark-deleted del-msg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
690 (while (and (not (if backward (bobp) (eobp))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
691 (save-excursion (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
692 (looking-at " *[0-9]+D"))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
693 (forward-line (if backward -1 1))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
694 ;; It looks ugly to move to the empty line at end of buffer. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
695 (and (eobp) (not backward) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
696 (forward-line -1)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
697 (setq count |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
698 (if (> count 0) (1- count) (1+ count)))))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
699 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
700 (defun pmail-summary-delete-backward (&optional count) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
701 "Delete this message and move to previous nondeleted one. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
702 Deleted messages stay in the file until the \\[pmail-expunge] command is given. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
703 A prefix argument serves as a repeat count; |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
704 a negative argument means to delete and move forward." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
705 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
706 (pmail-summary-delete-forward (- count))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
707 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
708 (defun pmail-summary-mark-deleted (&optional n undel) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
709 ;; Since third arg is t, this only alters the summary, not the Pmail buf. |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
710 (and n (pmail-summary-goto-msg n t t)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
711 (or (eobp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
712 (not (overlay-get pmail-summary-overlay 'face)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
713 (let ((buffer-read-only nil)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
714 (skip-chars-forward " ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
715 (skip-chars-forward "[0-9]") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
716 (if undel |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
717 (if (looking-at "D") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
718 (progn (delete-char 1) (insert " "))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
719 (delete-char 1) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
720 (insert "D")))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
721 (beginning-of-line)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
722 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
723 (defun pmail-summary-mark-undeleted (n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
724 (pmail-summary-mark-deleted n t)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
725 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
726 (defun pmail-summary-deleted-p (&optional n) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
727 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
728 (and n (pmail-summary-goto-msg n nil t)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
729 (skip-chars-forward " ") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
730 (skip-chars-forward "[0-9]") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
731 (looking-at "D"))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
732 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
733 (defun pmail-summary-undelete (&optional arg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
734 "Undelete current message. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
735 Optional prefix ARG means undelete ARG previous messages." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
736 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
737 (if (/= arg 1) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
738 (pmail-summary-undelete-many arg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
739 (let ((buffer-read-only nil) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
740 (opoint (point))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
741 (end-of-line) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
742 (cond ((re-search-backward "\\(^ *[0-9]*\\)\\(D\\)" nil t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
743 (replace-match "\\1 ") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
744 (pmail-summary-goto-msg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
745 (if pmail-enable-mime |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
746 (set-buffer pmail-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
747 (pop-to-buffer pmail-buffer)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
748 (and (pmail-message-deleted-p pmail-current-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
749 (pmail-undelete-previous-message)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
750 (if pmail-enable-mime |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
751 (pop-to-buffer pmail-buffer)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
752 (pop-to-buffer pmail-summary-buffer)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
753 (t (goto-char opoint)))))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
754 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
755 (defun pmail-summary-undelete-many (&optional n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
756 "Undelete all deleted msgs, optional prefix arg N means undelete N prev msgs." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
757 (interactive "P") |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
758 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
759 (set-buffer pmail-buffer) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
760 (let* ((init-msg (if n pmail-current-message pmail-total-messages)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
761 (pmail-current-message init-msg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
762 (n (or n pmail-total-messages)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
763 (msgs-undeled 0)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
764 (while (and (> pmail-current-message 0) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
765 (< msgs-undeled n)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
766 (if (pmail-message-deleted-p pmail-current-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
767 (progn (pmail-set-attribute "deleted" nil) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
768 (setq msgs-undeled (1+ msgs-undeled)))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
769 (setq pmail-current-message (1- pmail-current-message))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
770 (set-buffer pmail-summary-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
771 (setq pmail-current-message init-msg msgs-undeled 0) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
772 (while (and (> pmail-current-message 0) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
773 (< msgs-undeled n)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
774 (if (pmail-summary-deleted-p pmail-current-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
775 (progn (pmail-summary-mark-undeleted pmail-current-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
776 (setq msgs-undeled (1+ msgs-undeled)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
777 (setq pmail-current-message (1- pmail-current-message)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
778 (pmail-summary-goto-msg))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
779 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
780 ;; Pmail Summary mode is suitable only for specially formatted data. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
781 (put 'pmail-summary-mode 'mode-class 'special) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
782 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
783 (defun pmail-summary-mode () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
784 "Pmail Summary Mode is invoked from Pmail Mode by using \\<pmail-mode-map>\\[pmail-summary]. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
785 As commands are issued in the summary buffer, they are applied to the |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
786 corresponding mail messages in the pmail buffer. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
787 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
788 All normal editing commands are turned off. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
789 Instead, nearly all the Pmail mode commands are available, |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
790 though many of them move only among the messages in the summary. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
791 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
792 These additional commands exist: |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
793 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
794 \\[pmail-summary-undelete-many] Undelete all or prefix arg deleted messages. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
795 \\[pmail-summary-wipe] Delete the summary and go to the Pmail buffer. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
796 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
797 Commands for sorting the summary: |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
798 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
799 \\[pmail-summary-sort-by-date] Sort by date. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
800 \\[pmail-summary-sort-by-subject] Sort by subject. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
801 \\[pmail-summary-sort-by-author] Sort by author. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
802 \\[pmail-summary-sort-by-recipient] Sort by recipient. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
803 \\[pmail-summary-sort-by-correspondent] Sort by correspondent. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
804 \\[pmail-summary-sort-by-lines] Sort by lines. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
805 \\[pmail-summary-sort-by-labels] Sort by labels." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
806 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
807 (kill-all-local-variables) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
808 (setq major-mode 'pmail-summary-mode) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
809 (setq mode-name "PMAIL Summary") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
810 (setq truncate-lines t) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
811 (setq buffer-read-only t) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
812 (set-syntax-table text-mode-syntax-table) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
813 (make-local-variable 'pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
814 (make-local-variable 'pmail-total-messages) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
815 (make-local-variable 'pmail-current-message) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
816 (setq pmail-current-message nil) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
817 (make-local-variable 'pmail-summary-redo) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
818 (setq pmail-summary-redo nil) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
819 (make-local-variable 'revert-buffer-function) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
820 (make-local-variable 'font-lock-defaults) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
821 (setq font-lock-defaults '(pmail-summary-font-lock-keywords t)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
822 (pmail-summary-enable) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
823 (run-mode-hooks 'pmail-summary-mode-hook)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
824 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
825 ;; Summary features need to be disabled during edit mode. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
826 (defun pmail-summary-disable () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
827 (use-local-map text-mode-map) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
828 (remove-hook 'post-command-hook 'pmail-summary-pmail-update t) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
829 (setq revert-buffer-function nil)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
830 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
831 (defun pmail-summary-enable () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
832 (use-local-map pmail-summary-mode-map) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
833 (add-hook 'post-command-hook 'pmail-summary-pmail-update nil t) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
834 (setq revert-buffer-function 'pmail-update-summary)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
835 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
836 (defvar pmail-summary-put-back-unseen nil |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
837 "Used for communicating between calls to `pmail-summary-pmail-update'. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
838 If it moves to a message within an Incremental Search, and removes |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
839 the `unseen' attribute from that message, it sets this flag |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
840 so that if the next motion between messages is in the same Incremental |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
841 Search, the `unseen' attribute is restored.") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
842 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
843 ;; Show in Pmail the message described by the summary line that point is on, |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
844 ;; but only if the Pmail buffer is already visible. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
845 ;; This is a post-command-hook in summary buffers. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
846 (defun pmail-summary-pmail-update () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
847 (let (buffer-read-only) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
848 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
849 ;; If at end of buffer, pretend we are on the last text line. |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
850 (if (eobp) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
851 (forward-line -1)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
852 (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
853 (skip-chars-forward " ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
854 (let ((msg-num (string-to-number (buffer-substring |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
855 (point) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
856 (progn (skip-chars-forward "0-9") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
857 (point)))))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
858 ;; Always leave `unseen' removed |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
859 ;; if we get out of isearch mode. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
860 ;; Don't let a subsequent isearch restore that `unseen'. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
861 (if (not isearch-mode) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
862 (setq pmail-summary-put-back-unseen nil)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
863 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
864 (or (eq pmail-current-message msg-num) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
865 (let ((window (get-buffer-window pmail-buffer t)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
866 (owin (selected-window))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
867 (if isearch-mode |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
868 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
869 (set-buffer pmail-buffer) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
870 ;; If we first saw the previous message in this search, |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
871 ;; and we have gone to a different message while searching, |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
872 ;; put back `unseen' on the former one. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
873 (if pmail-summary-put-back-unseen |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
874 (pmail-set-attribute "unseen" t |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
875 pmail-current-message)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
876 ;; Arrange to do that later, for the new current message, |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
877 ;; if it still has `unseen'. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
878 (setq pmail-summary-put-back-unseen |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
879 (pmail-message-attr-p msg-num pmail-unseen-attr-index))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
880 (setq pmail-summary-put-back-unseen nil)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
881 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
882 ;; Go to the desired message. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
883 (setq pmail-current-message msg-num) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
884 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
885 ;; Update the summary to show the message has been seen. |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
886 (if (= (following-char) ?-) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
887 (progn |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
888 (delete-char 1) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
889 (insert " "))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
890 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
891 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
892 ;; Using save-window-excursion would cause the new value |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
893 ;; of point to get lost. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
894 (unwind-protect |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
895 (progn |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
896 (select-window window) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
897 (pmail-show-message-maybe msg-num t)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
898 (select-window owin)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
899 (if (buffer-name pmail-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
900 (save-excursion |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
901 (set-buffer pmail-buffer) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
902 (pmail-show-message-maybe msg-num t)))))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
903 (pmail-summary-update-highlight nil))))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
904 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
905 (defun pmail-summary-save-buffer () |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
906 "Save the buffer associated with this PMAIL summary." |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
907 (interactive) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
908 (save-window-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
909 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
910 (switch-to-buffer pmail-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
911 (save-buffer)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
912 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
913 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
914 (if pmail-summary-mode-map |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
915 nil |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
916 (setq pmail-summary-mode-map (make-keymap)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
917 (suppress-keymap pmail-summary-mode-map) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
918 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
919 (define-key pmail-summary-mode-map [mouse-2] 'pmail-summary-mouse-goto-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
920 (define-key pmail-summary-mode-map "a" 'pmail-summary-add-label) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
921 (define-key pmail-summary-mode-map "b" 'pmail-summary-bury) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
922 (define-key pmail-summary-mode-map "c" 'pmail-summary-continue) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
923 (define-key pmail-summary-mode-map "d" 'pmail-summary-delete-forward) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
924 (define-key pmail-summary-mode-map "\C-d" 'pmail-summary-delete-backward) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
925 (define-key pmail-summary-mode-map "e" 'pmail-summary-edit-current-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
926 (define-key pmail-summary-mode-map "f" 'pmail-summary-forward) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
927 (define-key pmail-summary-mode-map "g" 'pmail-summary-get-new-mail) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
928 (define-key pmail-summary-mode-map "h" 'pmail-summary) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
929 (define-key pmail-summary-mode-map "i" 'pmail-summary-input) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
930 (define-key pmail-summary-mode-map "j" 'pmail-summary-goto-msg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
931 (define-key pmail-summary-mode-map "\C-m" 'pmail-summary-goto-msg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
932 (define-key pmail-summary-mode-map "k" 'pmail-summary-kill-label) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
933 (define-key pmail-summary-mode-map "l" 'pmail-summary-by-labels) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
934 (define-key pmail-summary-mode-map "\e\C-h" 'pmail-summary) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
935 (define-key pmail-summary-mode-map "\e\C-l" 'pmail-summary-by-labels) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
936 (define-key pmail-summary-mode-map "\e\C-r" 'pmail-summary-by-recipients) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
937 (define-key pmail-summary-mode-map "\e\C-s" 'pmail-summary-by-regexp) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
938 (define-key pmail-summary-mode-map "\e\C-t" 'pmail-summary-by-topic) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
939 (define-key pmail-summary-mode-map "m" 'pmail-summary-mail) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
940 (define-key pmail-summary-mode-map "\M-m" 'pmail-summary-retry-failure) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
941 (define-key pmail-summary-mode-map "n" 'pmail-summary-next-msg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
942 (define-key pmail-summary-mode-map "\en" 'pmail-summary-next-all) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
943 (define-key pmail-summary-mode-map "\e\C-n" 'pmail-summary-next-labeled-message) |
100378
35a95343bc0c
All callers to pmail-output-to-pmail-file changed to
Chong Yidong <cyd@stupidchicken.com>
parents:
100291
diff
changeset
|
944 (define-key pmail-summary-mode-map "o" 'pmail-summary-output-to-babyl-file) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
945 (define-key pmail-summary-mode-map "\C-o" 'pmail-summary-output) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
946 (define-key pmail-summary-mode-map "p" 'pmail-summary-previous-msg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
947 (define-key pmail-summary-mode-map "\ep" 'pmail-summary-previous-all) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
948 (define-key pmail-summary-mode-map "\e\C-p" 'pmail-summary-previous-labeled-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
949 (define-key pmail-summary-mode-map "q" 'pmail-summary-quit) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
950 (define-key pmail-summary-mode-map "Q" 'pmail-summary-wipe) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
951 (define-key pmail-summary-mode-map "r" 'pmail-summary-reply) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
952 (define-key pmail-summary-mode-map "s" 'pmail-summary-expunge-and-save) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
953 (define-key pmail-summary-mode-map "\es" 'pmail-summary-search) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
954 (define-key pmail-summary-mode-map "t" 'pmail-summary-toggle-header) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
955 (define-key pmail-summary-mode-map "u" 'pmail-summary-undelete) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
956 (define-key pmail-summary-mode-map "\M-u" 'pmail-summary-undelete-many) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
957 (define-key pmail-summary-mode-map "x" 'pmail-summary-expunge) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
958 (define-key pmail-summary-mode-map "w" 'pmail-summary-output-body) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
959 (define-key pmail-summary-mode-map "." 'pmail-summary-beginning-of-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
960 (define-key pmail-summary-mode-map "/" 'pmail-summary-end-of-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
961 (define-key pmail-summary-mode-map "<" 'pmail-summary-first-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
962 (define-key pmail-summary-mode-map ">" 'pmail-summary-last-message) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
963 (define-key pmail-summary-mode-map " " 'pmail-summary-scroll-msg-up) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
964 (define-key pmail-summary-mode-map "\177" 'pmail-summary-scroll-msg-down) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
965 (define-key pmail-summary-mode-map "?" 'describe-mode) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
966 (define-key pmail-summary-mode-map "\C-c\C-n" 'pmail-summary-next-same-subject) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
967 (define-key pmail-summary-mode-map "\C-c\C-p" 'pmail-summary-previous-same-subject) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
968 (define-key pmail-summary-mode-map "\C-c\C-s\C-d" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
969 'pmail-summary-sort-by-date) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
970 (define-key pmail-summary-mode-map "\C-c\C-s\C-s" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
971 'pmail-summary-sort-by-subject) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
972 (define-key pmail-summary-mode-map "\C-c\C-s\C-a" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
973 'pmail-summary-sort-by-author) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
974 (define-key pmail-summary-mode-map "\C-c\C-s\C-r" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
975 'pmail-summary-sort-by-recipient) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
976 (define-key pmail-summary-mode-map "\C-c\C-s\C-c" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
977 'pmail-summary-sort-by-correspondent) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
978 (define-key pmail-summary-mode-map "\C-c\C-s\C-l" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
979 'pmail-summary-sort-by-lines) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
980 (define-key pmail-summary-mode-map "\C-c\C-s\C-k" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
981 'pmail-summary-sort-by-labels) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
982 (define-key pmail-summary-mode-map "\C-x\C-s" 'pmail-summary-save-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
983 ) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
984 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
985 ;;; Menu bar bindings. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
986 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
987 (define-key pmail-summary-mode-map [menu-bar] (make-sparse-keymap)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
988 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
989 (define-key pmail-summary-mode-map [menu-bar classify] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
990 (cons "Classify" (make-sparse-keymap "Classify"))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
991 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
992 (define-key pmail-summary-mode-map [menu-bar classify output-menu] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
993 '("Output (Pmail Menu)..." . pmail-summary-output-menu)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
994 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
995 (define-key pmail-summary-mode-map [menu-bar classify input-menu] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
996 '("Input Pmail File (menu)..." . pmail-input-menu)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
997 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
998 (define-key pmail-summary-mode-map [menu-bar classify input-menu] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
999 '(nil)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1000 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1001 (define-key pmail-summary-mode-map [menu-bar classify output-menu] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1002 '(nil)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1003 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1004 (define-key pmail-summary-mode-map [menu-bar classify output-body] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1005 '("Output (body)..." . pmail-summary-output-body)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1006 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1007 (define-key pmail-summary-mode-map [menu-bar classify output-inbox] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1008 '("Output (inbox)..." . pmail-summary-output)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1009 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1010 (define-key pmail-summary-mode-map [menu-bar classify output] |
100378
35a95343bc0c
All callers to pmail-output-to-pmail-file changed to
Chong Yidong <cyd@stupidchicken.com>
parents:
100291
diff
changeset
|
1011 '("Output (Pmail)..." . pmail-summary-output-to-babyl-file)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1012 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1013 (define-key pmail-summary-mode-map [menu-bar classify kill-label] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1014 '("Kill Label..." . pmail-summary-kill-label)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1015 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1016 (define-key pmail-summary-mode-map [menu-bar classify add-label] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1017 '("Add Label..." . pmail-summary-add-label)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1018 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1019 (define-key pmail-summary-mode-map [menu-bar summary] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1020 (cons "Summary" (make-sparse-keymap "Summary"))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1021 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1022 (define-key pmail-summary-mode-map [menu-bar summary senders] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1023 '("By Senders..." . pmail-summary-by-senders)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1024 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1025 (define-key pmail-summary-mode-map [menu-bar summary labels] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1026 '("By Labels..." . pmail-summary-by-labels)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1027 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1028 (define-key pmail-summary-mode-map [menu-bar summary recipients] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1029 '("By Recipients..." . pmail-summary-by-recipients)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1030 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1031 (define-key pmail-summary-mode-map [menu-bar summary topic] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1032 '("By Topic..." . pmail-summary-by-topic)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1033 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1034 (define-key pmail-summary-mode-map [menu-bar summary regexp] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1035 '("By Regexp..." . pmail-summary-by-regexp)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1036 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1037 (define-key pmail-summary-mode-map [menu-bar summary all] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1038 '("All" . pmail-summary)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1039 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1040 (define-key pmail-summary-mode-map [menu-bar mail] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1041 (cons "Mail" (make-sparse-keymap "Mail"))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1042 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1043 (define-key pmail-summary-mode-map [menu-bar mail pmail-summary-get-new-mail] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1044 '("Get New Mail" . pmail-summary-get-new-mail)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1045 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1046 (define-key pmail-summary-mode-map [menu-bar mail lambda] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1047 '("----")) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1048 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1049 (define-key pmail-summary-mode-map [menu-bar mail continue] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1050 '("Continue" . pmail-summary-continue)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1051 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1052 (define-key pmail-summary-mode-map [menu-bar mail resend] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1053 '("Re-send..." . pmail-summary-resend)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1054 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1055 (define-key pmail-summary-mode-map [menu-bar mail forward] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1056 '("Forward" . pmail-summary-forward)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1057 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1058 (define-key pmail-summary-mode-map [menu-bar mail retry] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1059 '("Retry" . pmail-summary-retry-failure)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1060 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1061 (define-key pmail-summary-mode-map [menu-bar mail reply] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1062 '("Reply" . pmail-summary-reply)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1063 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1064 (define-key pmail-summary-mode-map [menu-bar mail mail] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1065 '("Mail" . pmail-summary-mail)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1066 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1067 (define-key pmail-summary-mode-map [menu-bar delete] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1068 (cons "Delete" (make-sparse-keymap "Delete"))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1069 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1070 (define-key pmail-summary-mode-map [menu-bar delete expunge/save] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1071 '("Expunge/Save" . pmail-summary-expunge-and-save)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1072 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1073 (define-key pmail-summary-mode-map [menu-bar delete expunge] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1074 '("Expunge" . pmail-summary-expunge)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1075 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1076 (define-key pmail-summary-mode-map [menu-bar delete undelete] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1077 '("Undelete" . pmail-summary-undelete)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1078 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1079 (define-key pmail-summary-mode-map [menu-bar delete delete] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1080 '("Delete" . pmail-summary-delete-forward)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1081 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1082 (define-key pmail-summary-mode-map [menu-bar move] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1083 (cons "Move" (make-sparse-keymap "Move"))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1084 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1085 (define-key pmail-summary-mode-map [menu-bar move search-back] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1086 '("Search Back..." . pmail-summary-search-backward)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1087 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1088 (define-key pmail-summary-mode-map [menu-bar move search] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1089 '("Search..." . pmail-summary-search)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1090 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1091 (define-key pmail-summary-mode-map [menu-bar move previous] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1092 '("Previous Nondeleted" . pmail-summary-previous-msg)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1093 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1094 (define-key pmail-summary-mode-map [menu-bar move next] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1095 '("Next Nondeleted" . pmail-summary-next-msg)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1096 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1097 (define-key pmail-summary-mode-map [menu-bar move last] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1098 '("Last" . pmail-summary-last-message)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1099 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1100 (define-key pmail-summary-mode-map [menu-bar move first] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1101 '("First" . pmail-summary-first-message)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1102 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1103 (define-key pmail-summary-mode-map [menu-bar move previous] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1104 '("Previous" . pmail-summary-previous-all)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1105 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1106 (define-key pmail-summary-mode-map [menu-bar move next] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1107 '("Next" . pmail-summary-next-all)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1108 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1109 (defun pmail-summary-mouse-goto-message (event) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1110 "Select the message whose summary line you click on." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1111 (interactive "@e") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1112 (goto-char (posn-point (event-end event))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1113 (pmail-summary-goto-msg)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1114 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1115 (defun pmail-summary-goto-msg (&optional n nowarn skip-pmail) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1116 "Go to message N in the summary buffer and the Pmail buffer. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1117 If N is nil, use the message corresponding to point in the summary |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1118 and move to that message in the Pmail buffer. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1119 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1120 If NOWARN, don't say anything if N is out of range. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1121 If SKIP-PMAIL, don't do anything to the Pmail buffer." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1122 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1123 (if (consp n) (setq n (prefix-numeric-value n))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1124 (if (eobp) (forward-line -1)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1125 (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1126 (let* ((obuf (current-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1127 (buf pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1128 (cur (point)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1129 message-not-found |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1130 (curmsg (string-to-number |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1131 (buffer-substring (point) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1132 (min (point-max) (+ 6 (point)))))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1133 (total (save-excursion (set-buffer buf) pmail-total-messages))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1134 ;; If message number N was specified, find that message's line |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1135 ;; or set message-not-found. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1136 ;; If N wasn't specified or that message can't be found. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1137 ;; set N by default. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1138 (if (not n) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1139 (setq n curmsg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1140 (if (< n 1) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1141 (progn (message "No preceding message") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1142 (setq n 1))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1143 (if (and (> n total) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1144 (> total 0)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1145 (progn (message "No following message") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1146 (goto-char (point-max)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1147 (pmail-summary-goto-msg nil nowarn skip-pmail))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1148 (goto-char (point-min)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1149 (if (not (re-search-forward (format "^%5d[^0-9]" n) nil t)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1150 (progn (or nowarn (message "Message %d not found" n)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1151 (setq n curmsg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1152 (setq message-not-found t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1153 (goto-char cur)))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1154 (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1155 (skip-chars-forward " ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1156 (skip-chars-forward "0-9") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1157 (save-excursion (if (= (following-char) ?-) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1158 (let ((buffer-read-only nil)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1159 (delete-char 1) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1160 (insert " ")))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1161 (pmail-summary-update-highlight message-not-found) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1162 (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1163 (if skip-pmail |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1164 nil |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1165 (let ((selwin (selected-window))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1166 (unwind-protect |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1167 (progn (pop-to-buffer buf) |
100141
7512f1d3a1cb
(pmail-summary-goto-msg): Use pmail-show-message-maybe.
Chong Yidong <cyd@stupidchicken.com>
parents:
100128
diff
changeset
|
1168 (pmail-show-message-maybe n)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1169 (select-window selwin) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1170 ;; The actions above can alter the current buffer. Preserve it. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1171 (set-buffer obuf)))))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1172 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1173 ;; Update the highlighted line in an pmail summary buffer. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1174 ;; That should be current. We highlight the line point is on. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1175 ;; If NOT-FOUND is non-nil, we turn off highlighting. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1176 (defun pmail-summary-update-highlight (not-found) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1177 ;; Make sure we have an overlay to use. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1178 (or pmail-summary-overlay |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1179 (progn |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1180 (make-local-variable 'pmail-summary-overlay) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1181 (setq pmail-summary-overlay (make-overlay (point) (point))))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1182 ;; If this message is in the summary, use the overlay to highlight it. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1183 ;; Otherwise, don't highlight anything. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1184 (if not-found |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1185 (overlay-put pmail-summary-overlay 'face nil) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1186 (move-overlay pmail-summary-overlay |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1187 (save-excursion (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1188 (skip-chars-forward " ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1189 (point)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1190 (save-excursion (end-of-line) (point))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1191 (overlay-put pmail-summary-overlay 'face 'highlight))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1192 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1193 (defun pmail-summary-scroll-msg-up (&optional dist) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1194 "Scroll the Pmail window forward. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1195 If the Pmail window is displaying the end of a message, |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1196 advance to the next message." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1197 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1198 (if (eq dist '-) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1199 (pmail-summary-scroll-msg-down nil) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1200 (let ((pmail-buffer-window (get-buffer-window pmail-buffer))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1201 (if pmail-buffer-window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1202 (if (let ((pmail-summary-window (selected-window))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1203 (select-window pmail-buffer-window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1204 (prog1 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1205 ;; Is EOB visible in the buffer? |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1206 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1207 (let ((ht (window-height (selected-window)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1208 (move-to-window-line (- ht 2)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1209 (end-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1210 (eobp))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1211 (select-window pmail-summary-window))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1212 (if (not pmail-summary-scroll-between-messages) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1213 (error "End of buffer") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1214 (pmail-summary-next-msg (or dist 1))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1215 (let ((other-window-scroll-buffer pmail-buffer)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1216 (scroll-other-window dist))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1217 ;; If it isn't visible at all, show the beginning. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1218 (pmail-summary-beginning-of-message))))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1219 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1220 (defun pmail-summary-scroll-msg-down (&optional dist) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1221 "Scroll the Pmail window backward. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1222 If the Pmail window is now displaying the beginning of a message, |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1223 move to the previous message." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1224 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1225 (if (eq dist '-) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1226 (pmail-summary-scroll-msg-up nil) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1227 (let ((pmail-buffer-window (get-buffer-window pmail-buffer))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1228 (if pmail-buffer-window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1229 (if (let ((pmail-summary-window (selected-window))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1230 (select-window pmail-buffer-window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1231 (prog1 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1232 ;; Is BOB visible in the buffer? |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1233 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1234 (move-to-window-line 0) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1235 (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1236 (bobp)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1237 (select-window pmail-summary-window))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1238 (if (not pmail-summary-scroll-between-messages) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1239 (error "Beginning of buffer") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1240 (pmail-summary-previous-msg (or dist 1))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1241 (let ((other-window-scroll-buffer pmail-buffer)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1242 (scroll-other-window-down dist))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1243 ;; If it isn't visible at all, show the beginning. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1244 (pmail-summary-beginning-of-message))))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1245 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1246 (defun pmail-summary-beginning-of-message () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1247 "Show current message from the beginning." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1248 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1249 (pmail-summary-show-message 'BEG)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1250 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1251 (defun pmail-summary-end-of-message () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1252 "Show bottom of current message." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1253 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1254 (pmail-summary-show-message 'END)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1255 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1256 (defun pmail-summary-show-message (where) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1257 "Show current mail message. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1258 Position it according to WHERE which can be BEG or END" |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1259 (if (and (one-window-p) (not pop-up-frames)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1260 ;; If there is just one window, put the summary on the top. |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1261 (let ((buffer pmail-buffer)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1262 (split-window (selected-window) pmail-summary-window-size) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1263 (select-window (frame-first-window)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1264 (pop-to-buffer pmail-buffer) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1265 ;; If pop-to-buffer did not use that window, delete that |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1266 ;; window. (This can happen if it uses another frame.) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1267 (or (eq buffer (window-buffer (next-window (frame-first-window)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1268 (delete-other-windows))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1269 (pop-to-buffer pmail-buffer)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1270 (cond |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1271 ((eq where 'BEG) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1272 (goto-char (point-min)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1273 (search-forward "\n\n")) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1274 ((eq where 'END) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1275 (goto-char (point-max)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1276 (recenter (1- (window-height)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1277 ) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1278 (pop-to-buffer pmail-summary-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1279 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1280 (defun pmail-summary-bury () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1281 "Bury the Pmail buffer and the Pmail summary buffer." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1282 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1283 (let ((buffer-to-bury (current-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1284 (let (window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1285 (while (setq window (get-buffer-window pmail-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1286 (set-window-buffer window (other-buffer pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1287 (bury-buffer pmail-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1288 (switch-to-buffer (other-buffer buffer-to-bury)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1289 (bury-buffer buffer-to-bury))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1290 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1291 (defun pmail-summary-quit () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1292 "Quit out of Pmail and Pmail summary." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1293 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1294 (pmail-summary-wipe) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1295 (pmail-quit)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1296 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1297 (defun pmail-summary-wipe () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1298 "Kill and wipe away Pmail summary, remaining within Pmail." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1299 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1300 (save-excursion (set-buffer pmail-buffer) (setq pmail-summary-buffer nil)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1301 (let ((local-pmail-buffer pmail-buffer)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1302 (kill-buffer (current-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1303 ;; Delete window if not only one. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1304 (if (not (eq (selected-window) (next-window nil 'no-minibuf))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1305 (delete-window)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1306 ;; Switch windows to the pmail buffer, or switch to it in this window. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1307 (pop-to-buffer local-pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1308 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1309 (defun pmail-summary-expunge () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1310 "Actually erase all deleted messages and recompute summary headers." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1311 (interactive) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1312 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1313 (set-buffer pmail-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1314 (when (pmail-expunge-confirmed) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1315 (pmail-only-expunge))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1316 (pmail-update-summary)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1317 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1318 (defun pmail-summary-expunge-and-save () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1319 "Expunge and save PMAIL file." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1320 (interactive) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1321 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1322 (set-buffer pmail-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1323 (when (pmail-expunge-confirmed) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1324 (pmail-only-expunge))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1325 (pmail-update-summary) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1326 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1327 (set-buffer pmail-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1328 (save-buffer)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1329 (set-buffer-modified-p nil)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1330 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1331 (defun pmail-summary-get-new-mail (&optional file-name) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1332 "Get new mail and recompute summary headers. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1333 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1334 Optionally you can specify the file to get new mail from. In this case, |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1335 the file of new mail is not changed or deleted. Noninteractively, you can |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1336 pass the inbox file name as an argument. Interactively, a prefix |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1337 argument says to read a file name and use that file as the inbox." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1338 (interactive |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1339 (list (if current-prefix-arg |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1340 (read-file-name "Get new mail from file: ")))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1341 (let (msg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1342 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1343 (set-buffer pmail-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1344 (pmail-get-new-mail file-name) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1345 ;; Get the proper new message number. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1346 (setq msg pmail-current-message)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1347 ;; Make sure that message is displayed. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1348 (or (zerop msg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1349 (pmail-summary-goto-msg msg)))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1350 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1351 (defun pmail-summary-input (filename) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1352 "Run Pmail on file FILENAME." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1353 (interactive "FRun pmail on PMAIL file: ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1354 ;; We switch windows here, then display the other Pmail file there. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1355 (pop-to-buffer pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1356 (pmail filename)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1357 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1358 (defun pmail-summary-first-message () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1359 "Show first message in Pmail file from summary buffer." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1360 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1361 (with-no-warnings |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1362 (beginning-of-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1363 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1364 (defun pmail-summary-last-message () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1365 "Show last message in Pmail file from summary buffer." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1366 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1367 (with-no-warnings |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1368 (end-of-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1369 (forward-line -1)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1370 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1371 (declare-function pmail-abort-edit "pmailedit" ()) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1372 (declare-function pmail-cease-edit "pmailedit"()) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1373 (declare-function pmail-set-label "pmailkwd" (l state &optional n)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1374 (declare-function pmail-output-read-file-name "pmailout" ()) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1375 (declare-function mail-send-and-exit "sendmail" (&optional arg)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1376 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1377 (defvar pmail-summary-edit-map nil) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1378 (if pmail-summary-edit-map |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1379 nil |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1380 (setq pmail-summary-edit-map |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1381 (nconc (make-sparse-keymap) text-mode-map)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1382 (define-key pmail-summary-edit-map "\C-c\C-c" 'pmail-cease-edit) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1383 (define-key pmail-summary-edit-map "\C-c\C-]" 'pmail-abort-edit)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1384 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1385 (defun pmail-summary-edit-current-message () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1386 "Edit the contents of this message." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1387 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1388 (pop-to-buffer pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1389 (pmail-edit-current-message) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1390 (use-local-map pmail-summary-edit-map)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1391 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1392 (defun pmail-summary-cease-edit () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1393 "Finish editing message, then go back to Pmail summary buffer." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1394 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1395 (pmail-cease-edit) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1396 (pop-to-buffer pmail-summary-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1397 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1398 (defun pmail-summary-abort-edit () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1399 "Abort edit of current message; restore original contents. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1400 Go back to summary buffer." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1401 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1402 (pmail-abort-edit) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1403 (pop-to-buffer pmail-summary-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1404 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1405 (defun pmail-summary-search-backward (regexp &optional n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1406 "Show message containing next match for REGEXP. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1407 Prefix argument gives repeat count; negative argument means search |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1408 backwards (through earlier messages). |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1409 Interactively, empty argument means use same regexp used last time." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1410 (interactive |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1411 (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1412 (prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1413 (concat (if reversep "Reverse " "") "Pmail search (regexp")) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1414 regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1415 (setq prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1416 (concat prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1417 (if pmail-search-last-regexp |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1418 (concat ", default " |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1419 pmail-search-last-regexp "): ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1420 "): "))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1421 (setq regexp (read-string prompt)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1422 (cond ((not (equal regexp "")) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1423 (setq pmail-search-last-regexp regexp)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1424 ((not pmail-search-last-regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1425 (error "No previous Pmail search string"))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1426 (list pmail-search-last-regexp |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1427 (prefix-numeric-value current-prefix-arg)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1428 ;; Don't use save-excursion because that prevents point from moving |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1429 ;; properly in the summary buffer. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1430 (let ((buffer (current-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1431 (unwind-protect |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1432 (progn |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1433 (set-buffer pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1434 (pmail-search regexp (- n))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1435 (set-buffer buffer)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1436 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1437 (defun pmail-summary-search (regexp &optional n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1438 "Show message containing next match for REGEXP. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1439 Prefix argument gives repeat count; negative argument means search |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1440 backwards (through earlier messages). |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1441 Interactively, empty argument means use same regexp used last time." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1442 (interactive |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1443 (let* ((reversep (< (prefix-numeric-value current-prefix-arg) 0)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1444 (prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1445 (concat (if reversep "Reverse " "") "Pmail search (regexp")) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1446 regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1447 (setq prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1448 (concat prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1449 (if pmail-search-last-regexp |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1450 (concat ", default " |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1451 pmail-search-last-regexp "): ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1452 "): "))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1453 (setq regexp (read-string prompt)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1454 (cond ((not (equal regexp "")) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1455 (setq pmail-search-last-regexp regexp)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1456 ((not pmail-search-last-regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1457 (error "No previous Pmail search string"))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1458 (list pmail-search-last-regexp |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1459 (prefix-numeric-value current-prefix-arg)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1460 ;; Don't use save-excursion because that prevents point from moving |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1461 ;; properly in the summary buffer. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1462 (let ((buffer (current-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1463 (unwind-protect |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1464 (progn |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1465 (set-buffer pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1466 (pmail-search regexp n)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1467 (set-buffer buffer)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1468 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1469 (defun pmail-summary-toggle-header () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1470 "Show original message header if pruned header currently shown, or vice versa." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1471 (interactive) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1472 (save-window-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1473 (set-buffer pmail-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1474 (pmail-toggle-header)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1475 ;; Inside save-excursion, some changes to point in the PMAIL buffer are lost. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1476 ;; Set point to point-min in the PMAIL buffer, if it is visible. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1477 (let ((window (get-buffer-window pmail-buffer))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1478 (if window |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1479 ;; Using save-window-excursion would lose the new value of point. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1480 (let ((owin (selected-window))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1481 (unwind-protect |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1482 (progn |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1483 (select-window window) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1484 (goto-char (point-min))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1485 (select-window owin)))))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1486 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1487 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1488 (defun pmail-summary-add-label (label) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1489 "Add LABEL to labels associated with current Pmail message. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1490 Completion is performed over known labels when reading." |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1491 (interactive (list (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1492 (set-buffer pmail-buffer) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1493 (pmail-read-label "Add label")))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1494 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1495 (set-buffer pmail-buffer) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1496 (pmail-add-label label))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1497 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1498 (defun pmail-summary-kill-label (label) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1499 "Remove LABEL from labels associated with current Pmail message. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1500 Completion is performed over known labels when reading." |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1501 (interactive (list (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1502 (set-buffer pmail-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1503 (pmail-read-label "Kill label")))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1504 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1505 (set-buffer pmail-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1506 (pmail-set-label label nil))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1507 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1508 ;;;; *** Pmail Summary Mailing Commands *** |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1509 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1510 (defun pmail-summary-override-mail-send-and-exit () |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1511 "Replace bindings to `mail-send-and-exit' with `pmail-summary-send-and-exit'." |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1512 (use-local-map (copy-keymap (current-local-map))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1513 (dolist (key (where-is-internal 'mail-send-and-exit)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1514 (define-key (current-local-map) key 'pmail-summary-send-and-exit))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1515 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1516 (defun pmail-summary-mail () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1517 "Send mail in another window. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1518 While composing the message, use \\[mail-yank-original] to yank the |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1519 original message into it." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1520 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1521 (let ((window (get-buffer-window pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1522 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1523 (select-window window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1524 (set-buffer pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1525 (pmail-start-mail nil nil nil nil nil (current-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1526 (pmail-summary-override-mail-send-and-exit)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1527 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1528 (defun pmail-summary-continue () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1529 "Continue composing outgoing message previously being composed." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1530 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1531 (let ((window (get-buffer-window pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1532 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1533 (select-window window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1534 (set-buffer pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1535 (pmail-start-mail t)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1536 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1537 (defun pmail-summary-reply (just-sender) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1538 "Reply to the current message. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1539 Normally include CC: to all other recipients of original message; |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1540 prefix argument means ignore them. While composing the reply, |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1541 use \\[mail-yank-original] to yank the original message into it." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1542 (interactive "P") |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1543 (let ((window (get-buffer-window pmail-buffer))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1544 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1545 (select-window window) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1546 (set-buffer pmail-buffer))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1547 (pmail-reply just-sender) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1548 (pmail-summary-override-mail-send-and-exit)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1549 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1550 (defun pmail-summary-retry-failure () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1551 "Edit a mail message which is based on the contents of the current message. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1552 For a message rejected by the mail system, extract the interesting headers and |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1553 the body of the original message; otherwise copy the current message." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1554 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1555 (let ((window (get-buffer-window pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1556 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1557 (select-window window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1558 (set-buffer pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1559 (pmail-retry-failure) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1560 (pmail-summary-override-mail-send-and-exit)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1561 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1562 (defun pmail-summary-send-and-exit () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1563 "Send mail reply and return to summary buffer." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1564 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1565 (mail-send-and-exit t)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1566 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1567 (defun pmail-summary-forward (resend) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1568 "Forward the current message to another user. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1569 With prefix argument, \"resend\" the message instead of forwarding it; |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1570 see the documentation of `pmail-resend'." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1571 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1572 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1573 (let ((window (get-buffer-window pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1574 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1575 (select-window window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1576 (set-buffer pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1577 (pmail-forward resend) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1578 (pmail-summary-override-mail-send-and-exit))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1579 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1580 (defun pmail-summary-resend () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1581 "Resend current message using `pmail-resend'." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1582 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1583 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1584 (let ((window (get-buffer-window pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1585 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1586 (select-window window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1587 (set-buffer pmail-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1588 (call-interactively 'pmail-resend))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1589 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1590 ;; Summary output commands. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1591 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1592 (defun pmail-summary-output (&optional file-name n) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1593 "Append this message to mail file FILE-NAME. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1594 This works with both mbox format and Babyl format files, |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1595 outputting in the appropriate format for each. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1596 The default file name comes from `pmail-default-file', |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1597 which is updated to the name you use in this command. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1598 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1599 A prefix argument N says to output that many consecutive messages |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1600 from those in the summary, starting with the current one. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1601 Deleted messages are skipped and don't count. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1602 When called from Lisp code, N may be omitted and defaults to 1. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1603 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1604 This command always outputs the complete message header, |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1605 even the header display is currently pruned." |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1606 (interactive |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1607 (progn (require 'pmailout) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1608 (list (pmail-output-read-file-name) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1609 (prefix-numeric-value current-prefix-arg)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1610 (let ((i 0) prev-msg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1611 (while |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1612 (and (< i n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1613 (progn (pmail-summary-goto-msg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1614 (not (eq prev-msg |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1615 (setq prev-msg |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1616 (with-current-buffer pmail-buffer |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1617 pmail-current-message)))))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1618 (setq i (1+ i)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1619 (with-current-buffer pmail-buffer |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1620 (let ((pmail-delete-after-output nil)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1621 (pmail-output file-name 1))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1622 (if pmail-delete-after-output |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1623 (pmail-summary-delete-forward nil) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1624 (if (< i n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1625 (pmail-summary-next-msg 1)))))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1626 |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1627 (defalias 'pmail-summary-output-to-pmail-file |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1628 'pmail-summary-output-to-babyl-file) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1629 |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1630 (defun pmail-summary-output-as-seen (&optional file-name n) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1631 "Append this message to system-inbox-format mail file named FILE-NAME. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1632 A prefix argument N says to output that many consecutive messages, |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1633 from the summary, starting with the current one. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1634 Deleted messages are skipped and don't count. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1635 When called from Lisp code, N may be omitted and defaults to 1. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1636 |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1637 This outputs the message header as you see it (or would see it) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1638 displayed in Pmail. |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1639 |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1640 The default file name comes from `pmail-default-file', |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1641 which is updated to the name you use in this command." |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1642 (interactive |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1643 (progn (require 'pmailout) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1644 (list (pmail-output-read-file-name) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1645 (prefix-numeric-value current-prefix-arg)))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1646 (let ((i 0) prev-msg) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1647 (while |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1648 (and (< i n) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1649 (progn (pmail-summary-goto-msg) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1650 (not (eq prev-msg |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1651 (setq prev-msg |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1652 (with-current-buffer pmail-buffer |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1653 pmail-current-message)))))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1654 (setq i (1+ i)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1655 (with-current-buffer pmail-buffer |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1656 (let ((pmail-delete-after-output nil)) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1657 (pmail-output-as-seen file-name 1))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1658 (if pmail-delete-after-output |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1659 (pmail-summary-delete-forward nil) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1660 (if (< i n) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1661 (pmail-summary-next-msg 1)))))) |
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1662 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1663 (defun pmail-summary-output-menu () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1664 "Output current message to another Pmail file, chosen with a menu. |
100378
35a95343bc0c
All callers to pmail-output-to-pmail-file changed to
Chong Yidong <cyd@stupidchicken.com>
parents:
100291
diff
changeset
|
1665 Also set the default for subsequent \\[pmail-output-to-babyl-file] commands. |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1666 The variables `pmail-secondary-file-directory' and |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1667 `pmail-secondary-file-regexp' control which files are offered in the menu." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1668 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1669 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1670 (set-buffer pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1671 (let ((pmail-delete-after-output nil)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1672 (call-interactively 'pmail-output-menu))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1673 (if pmail-delete-after-output |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1674 (pmail-summary-delete-forward nil))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1675 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1676 (defun pmail-summary-construct-io-menu () |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1677 (let ((files (pmail-find-all-files pmail-secondary-file-directory))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1678 (if files |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1679 (progn |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1680 (define-key pmail-summary-mode-map [menu-bar classify input-menu] |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1681 (cons "Input Pmail File" |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1682 (pmail-list-to-menu "Input Pmail File" |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1683 files |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1684 'pmail-summary-input))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1685 (define-key pmail-summary-mode-map [menu-bar classify output-menu] |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1686 (cons "Output Pmail File" |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1687 (pmail-list-to-menu "Output Pmail File" |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1688 files |
100911
21becd9cb5d4
(pmail-message-labels-p): Function moved from pmail.el and rewritten.
Richard M. Stallman <rms@gnu.org>
parents:
100908
diff
changeset
|
1689 'pmail-summary-output)))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1690 (define-key pmail-summary-mode-map [menu-bar classify input-menu] |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1691 '("Input Pmail File" . pmail-disable-menu)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1692 (define-key pmail-summary-mode-map [menu-bar classify output-menu] |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1693 '("Output Pmail File" . pmail-disable-menu))))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1694 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1695 (defun pmail-summary-output-body (&optional file-name) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1696 "Write this message body to the file FILE-NAME. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1697 FILE-NAME defaults, interactively, from the Subject field of the message." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1698 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1699 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1700 (set-buffer pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1701 (let ((pmail-delete-after-output nil)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1702 (if file-name |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1703 (pmail-output-body-to-file file-name) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1704 (call-interactively 'pmail-output-body-to-file)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1705 (if pmail-delete-after-output |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1706 (pmail-summary-delete-forward nil))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1707 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1708 ;; Sorting messages in Pmail Summary buffer. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1709 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1710 (defun pmail-summary-sort-by-date (reverse) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1711 "Sort messages of current Pmail summary by date. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1712 If prefix argument REVERSE is non-nil, sort them in reverse order." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1713 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1714 (pmail-sort-from-summary (function pmail-sort-by-date) reverse)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1715 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1716 (defun pmail-summary-sort-by-subject (reverse) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1717 "Sort messages of current Pmail summary by subject. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1718 If prefix argument REVERSE is non-nil, sort them in reverse order." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1719 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1720 (pmail-sort-from-summary (function pmail-sort-by-subject) reverse)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1721 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1722 (defun pmail-summary-sort-by-author (reverse) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1723 "Sort messages of current Pmail summary by author. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1724 If prefix argument REVERSE is non-nil, sort them in reverse order." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1725 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1726 (pmail-sort-from-summary (function pmail-sort-by-author) reverse)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1727 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1728 (defun pmail-summary-sort-by-recipient (reverse) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1729 "Sort messages of current Pmail summary by recipient. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1730 If prefix argument REVERSE is non-nil, sort them in reverse order." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1731 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1732 (pmail-sort-from-summary (function pmail-sort-by-recipient) reverse)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1733 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1734 (defun pmail-summary-sort-by-correspondent (reverse) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1735 "Sort messages of current Pmail summary by other correspondent. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1736 If prefix argument REVERSE is non-nil, sort them in reverse order." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1737 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1738 (pmail-sort-from-summary (function pmail-sort-by-correspondent) reverse)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1739 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1740 (defun pmail-summary-sort-by-lines (reverse) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1741 "Sort messages of current Pmail summary by lines of the message. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1742 If prefix argument REVERSE is non-nil, sort them in reverse order." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1743 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1744 (pmail-sort-from-summary (function pmail-sort-by-lines) reverse)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1745 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1746 (defun pmail-summary-sort-by-labels (reverse labels) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1747 "Sort messages of current Pmail summary by labels. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1748 If prefix argument REVERSE is non-nil, sort them in reverse order. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1749 KEYWORDS is a comma-separated list of labels." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1750 (interactive "P\nsSort by labels: ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1751 (pmail-sort-from-summary |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1752 (function (lambda (reverse) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1753 (pmail-sort-by-labels reverse labels))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1754 reverse)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1755 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1756 (defun pmail-sort-from-summary (sortfun reverse) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1757 "Sort Pmail messages from Summary buffer and update it after sorting." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1758 (require 'pmailsort) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1759 (let ((selwin (selected-window))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1760 (unwind-protect |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1761 (progn (pop-to-buffer pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1762 (funcall sortfun reverse)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1763 (select-window selwin)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1764 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1765 (provide 'pmailsum) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1766 |
100655
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
1767 ;; Local Variables: |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
1768 ;; change-log-default-name: "ChangeLog.pmail" |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
1769 ;; End: |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
1770 |
97533 | 1771 ;; arch-tag: 80b0a27a-a50d-4f37-9466-83d32d1e0ca8 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1772 ;;; pmailsum.el ends here |