Mercurial > emacs
annotate lisp/mail/pmailsum.el @ 100899:4949ca7093eb
Update copyright for 2009.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Mon, 05 Jan 2009 00:54:53 +0000 |
parents | 4f54978ec0c5 |
children | a9dc0e7c3f2b |
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, |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
4 ;; 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
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 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
95 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
96 (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
|
97 "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
|
98 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
|
99 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
|
100 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
|
101 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
|
102 (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
|
103 (pmail-new-summary |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
104 (concat "recipients " recipients) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
105 (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
|
106 '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
|
107 (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
|
108 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
109 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
110 (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
|
111 "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
|
112 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
|
113 \(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
|
114 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
|
115 (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
|
116 (if (string= regexp "") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
117 (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
|
118 (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
|
119 (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
|
120 (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
|
121 (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
|
122 '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
|
123 regexp)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
124 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
125 ;; 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
|
126 ;; 1989 R.A. Schnitzler |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
127 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
128 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
129 (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
|
130 "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
|
131 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
|
132 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
|
133 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
|
134 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
|
135 (interactive |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
136 (let* ((subject (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
|
137 (pmail-current-subject))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
138 (subject-re (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
|
139 (pmail-current-subject-regexp))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
140 (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
|
141 (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
|
142 "): "))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
143 (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
|
144 (pmail-new-summary |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
145 (concat "about " subject) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
146 (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
|
147 '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
|
148 (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
|
149 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
150 (defun pmail-message-subject-p (msg subject &optional whole-message) |
100655
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
151 ;;;??? BROKEN |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
152 (error "pmail-message-subject-p has not been updated for Pmail") |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
153 (save-restriction |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
154 (goto-char (pmail-msgbeg msg)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
155 (search-forward "\n*** EOOH ***\n" (pmail-msgend msg) 'move) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
156 (narrow-to-region |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
157 (point) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
158 (progn (search-forward (if whole-message "\^_" "\n\n")) (point))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
159 (goto-char (point-min)) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
160 (if whole-message (re-search-forward subject nil t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
161 (string-match subject (let ((subj (mail-fetch-field "Subject"))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
162 (if subj |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
163 (funcall pmail-summary-line-decoder subj) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
164 "")))))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
165 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
166 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
167 (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
|
168 "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
|
169 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
|
170 (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
|
171 (pmail-new-summary |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
172 (concat "senders " senders) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
173 (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
|
174 '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
|
175 (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
|
176 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
177 (defun pmail-message-senders-p (msg senders) |
100655
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
178 ;;;??? BROKEN |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
179 (error "pmail-message-senders-p has not been updated for Pmail") |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
180 (save-restriction |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
181 (goto-char (pmail-msgbeg msg)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
182 (search-forward "\n*** EOOH ***\n") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
183 (narrow-to-region (point) (progn (search-forward "\n\n") (point))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
184 (string-match senders (or (mail-fetch-field "From") "")))) |
97528
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 ;; 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
|
187 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
188 (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
|
189 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
190 (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
|
191 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
192 (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
|
193 "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
|
194 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
|
195 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
|
196 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
|
197 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
|
198 (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
|
199 (unless pmail-buffer |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
200 (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
|
201 (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
|
202 (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
|
203 (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
|
204 (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
|
205 (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
|
206 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
|
207 ;; 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
|
208 (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
|
209 (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
|
210 pop-up-windows |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
211 (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
|
212 ;; 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
|
213 (progn |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
214 (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
|
215 (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
|
216 (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
|
217 ;; 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
|
218 ;; 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
|
219 (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
|
220 (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
|
221 (delete-other-windows))) |
e21451392719
(pmail-new-summary): Check for pmail-summary-mode in the current
Chong Yidong <cyd@stupidchicken.com>
parents:
100120
diff
changeset
|
222 (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
|
223 (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
|
224 ;; 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
|
225 ;; 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
|
226 (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
|
227 (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
|
228 (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
|
229 (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
|
230 (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
|
231 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
232 (defun pmail-new-summary-1 (description form function &rest args) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
233 "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
|
234 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
|
235 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
236 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
|
237 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
|
238 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
239 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
|
240 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
241 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
|
242 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
|
243 message." |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
244 (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
|
245 (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
|
246 (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
|
247 ;; 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
|
248 ;; 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
|
249 (let ((msgnum 1) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
250 (total pmail-total-messages) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
251 (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
|
252 (save-excursion |
100655
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
253 (if (pmail-buffers-swapped-p) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
254 (set-buffer pmail-view-buffer)) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
255 (let ((old-min (point-min-marker)) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
256 (old-max (point-max-marker))) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
257 (unwind-protect |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
258 ;; 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
|
259 ;; 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
|
260 (save-excursion |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
261 (widen) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
262 (goto-char (point-min)) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
263 (while (>= total msgnum) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
264 ;; First test whether to include this message. |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
265 (if (or (null function) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
266 (apply function (cons msgnum args))) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
267 (setq summary-msgs |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
268 ;; Go back to the Pmail buffer so |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
269 ;; so pmail-get-summary can see its local vars. |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
270 (with-current-buffer pmail-buffer |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
271 (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
|
272 summary-msgs)))) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
273 (setq msgnum (1+ msgnum)) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
274 ;; Provide a periodic User progress message. |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
275 (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
|
276 (message "Computing summary lines...%d" |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
277 pmail-new-summary-line-count))) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
278 (setq summary-msgs (nreverse summary-msgs))) |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
279 (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
|
280 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
281 ;; 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
|
282 ;; 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
|
283 ;; |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
284 ;; 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
|
285 ;; 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
|
286 ;; 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
|
287 (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
|
288 (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
|
289 (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
|
290 (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
|
291 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
292 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
293 (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
|
294 (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
|
295 (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
|
296 ;; 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
|
297 (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
|
298 (erase-buffer) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
299 (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
|
300 (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
|
301 (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
|
302 (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
|
303 ;; 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
|
304 (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
|
305 (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
|
306 (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
|
307 (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
|
308 (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
|
309 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
|
310 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
|
311 sumbuf)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
312 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
313 (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
|
314 "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
|
315 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
|
316 (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
|
317 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
|
318 (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
|
319 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
320 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
321 ;; 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
|
322 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
323 (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
|
324 "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
|
325 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
|
326 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
|
327 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
|
328 returned. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
329 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
330 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
|
331 (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
|
332 (unless line |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
333 ;; 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
|
334 (setq pmail-new-summary-line-count (1+ 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
|
335 line (pmail-get-create-summary-line msgnum)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
336 ;; 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
|
337 (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
|
338 line)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
339 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
340 ;;;###autoload |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
341 (defcustom pmail-summary-line-decoder (function identity) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
342 "*Function to decode summary-line. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
343 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
344 By default, `identity' is set." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
345 :type 'function |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
346 :group 'pmail-summary) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
347 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
348 (defun pmail-get-create-summary-line (msgnum) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
349 "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
|
350 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
|
351 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
|
352 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
353 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
|
354 (let ((beg (pmail-msgbeg msgnum)) |
100291
c9bb16a15af4
(pmail-summary-header): Deleted.
Chong Yidong <cyd@stupidchicken.com>
parents:
100141
diff
changeset
|
355 (end (pmail-msgend msgnum))) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
356 (goto-char beg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
357 (if (search-forward "\n\n" end t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
358 (save-restriction |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
359 (narrow-to-region beg (point)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
360 ;; Generate a status line from the message and put it in the |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
361 ;; message. |
100291
c9bb16a15af4
(pmail-summary-header): Deleted.
Chong Yidong <cyd@stupidchicken.com>
parents:
100141
diff
changeset
|
362 (pmail-create-summary msgnum)) |
c9bb16a15af4
(pmail-summary-header): Deleted.
Chong Yidong <cyd@stupidchicken.com>
parents:
100141
diff
changeset
|
363 (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
|
364 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
365 (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
|
366 "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
|
367 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
368 The current buffer is narrowed to the message headers for |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
369 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
|
370 (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
|
371 (index 0) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
372 (result "") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
373 char) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
374 ;; 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
|
375 ;; 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
|
376 (setq status |
47671319c860
(pmail-get-summary-labels): If no attribute headers are found, use the
Chong Yidong <cyd@stupidchicken.com>
parents:
98526
diff
changeset
|
377 (if status |
47671319c860
(pmail-get-summary-labels): If no attribute headers are found, use the
Chong Yidong <cyd@stupidchicken.com>
parents:
98526
diff
changeset
|
378 (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
|
379 "")) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
380 (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
|
381 (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
|
382 (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
|
383 (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
|
384 (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
|
385 (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
|
386 result)) |
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-create-summary (msgnum) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
389 "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
|
390 The current buffer is narrowed to the header 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
|
391 (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
|
392 (let ((line (pmail-make-basic-summary-line)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
393 (labels (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
|
394 pos prefix status suffix) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
395 (setq pos (string-match "#" line) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
396 status (cond |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
397 ((pmail-message-deleted-p msgnum) ?D) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
398 ((pmail-message-unseen-p msgnum) ?-) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
399 (t ? )) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
400 prefix (format "%5d%c %s" msgnum status (substring line 0 pos)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
401 suffix (substring line (1+ pos))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
402 (funcall pmail-summary-line-decoder (concat prefix labels suffix)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
403 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
404 ;;;###autoload |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
405 (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
|
406 "*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
|
407 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
|
408 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
|
409 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
|
410 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
|
411 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
|
412 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
413 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
|
414 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
|
415 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
|
416 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
417 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
|
418 :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
|
419 :group 'pmail-retrieve |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
420 :version "21.1") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
421 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
422 (defun pmail-make-basic-summary-line () |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
423 (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
|
424 (concat (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
425 (if (not (re-search-forward "^Date:" nil t)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
426 " " |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
427 (cond ((re-search-forward "\\([^0-9:]\\)\\([0-3]?[0-9]\\)\\([- \t_]+\\)\\([adfjmnos][aceopu][bcglnprtvy]\\)" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
428 (save-excursion (end-of-line) (point)) t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
429 (format "%2d-%3s" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
430 (string-to-number (buffer-substring |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
431 (match-beginning 2) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
432 (match-end 2))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
433 (buffer-substring |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
434 (match-beginning 4) (match-end 4)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
435 ((re-search-forward "\\([^a-z]\\)\\([adfjmnos][acepou][bcglnprtvy]\\)\\([-a-z \t_]*\\)\\([0-9][0-9]?\\)" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
436 (save-excursion (end-of-line) (point)) t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
437 (format "%2d-%3s" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
438 (string-to-number (buffer-substring |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
439 (match-beginning 4) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
440 (match-end 4))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
441 (buffer-substring |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
442 (match-beginning 2) (match-end 2)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
443 ((re-search-forward "\\(19\\|20\\)\\([0-9][0-9]\\)-\\([01][0-9]\\)-\\([0-3][0-9]\\)" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
444 (save-excursion (end-of-line) (point)) t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
445 (format "%2s%2s%2s" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
446 (buffer-substring |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
447 (match-beginning 2) (match-end 2)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
448 (buffer-substring |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
449 (match-beginning 3) (match-end 3)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
450 (buffer-substring |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
451 (match-beginning 4) (match-end 4)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
452 (t "??????")))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
453 " " |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
454 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
455 (let* ((from (and (re-search-forward "^From:[ \t]*" nil t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
456 (mail-strip-quoted-names |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
457 (buffer-substring |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
458 (1- (point)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
459 ;; Get all the lines of the From field |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
460 ;; so that we get a whole comment if there is one, |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
461 ;; so that mail-strip-quoted-names can discard it. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
462 (let ((opoint (point))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
463 (while (progn (forward-line 1) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
464 (looking-at "[ \t]"))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
465 ;; Back up over newline, then trailing spaces or tabs |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
466 (forward-char -1) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
467 (skip-chars-backward " \t") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
468 (point)))))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
469 len mch lo) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
470 (if (or (null from) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
471 (string-match |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
472 (or pmail-user-mail-address-regexp |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
473 (concat "^\\(" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
474 (regexp-quote (user-login-name)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
475 "\\($\\|@\\)\\|" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
476 (regexp-quote |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
477 ;; Don't lose if run from init file |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
478 ;; where user-mail-address is not |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
479 ;; set yet. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
480 (or 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
|
481 (concat (user-login-name) "@" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
482 (or mail-host-address |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
483 (system-name))))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
484 "\\>\\)")) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
485 from)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
486 ;; No From field, or it's this user. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
487 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
488 (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
|
489 (if (not (re-search-forward "^To:[ \t]*" nil t)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
490 nil |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
491 (setq from |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
492 (concat "to: " |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
493 (mail-strip-quoted-names |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
494 (buffer-substring |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
495 (point) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
496 (progn (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
|
497 (skip-chars-backward " \t") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
498 (point))))))))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
499 (if (null from) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
500 " " |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
501 (setq len (length from)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
502 (setq mch (string-match "[@%]" from)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
503 (format "%25s" |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
504 (if (or (not mch) (<= len 25)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
505 (substring from (max 0 (- len 25))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
506 (substring from |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
507 (setq lo (cond ((< (- mch 14) 0) 0) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
508 ((< len (+ mch 11)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
509 (- len 25)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
510 (t (- mch 14)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
511 (min len (+ lo 25)))))))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
512 (if pmail-summary-line-count-flag |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
513 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
514 (save-restriction |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
515 (widen) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
516 (let ((beg (pmail-msgbeg msgnum)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
517 (end (pmail-msgend msgnum)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
518 lines) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
519 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
520 (goto-char beg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
521 ;; Count only lines in the reformatted header, |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
522 ;; if we have reformatted it. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
523 (search-forward "\n*** EOOH ***\n" end t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
524 (setq lines (count-lines (point) end))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
525 (format (cond |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
526 ((<= lines 9) " [%d]") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
527 ((<= lines 99) " [%d]") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
528 ((<= lines 999) " [%3d]") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
529 (t "[%d]")) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
530 lines)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
531 " ") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
532 " #" ;The # is part of the format. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
533 (if (re-search-forward "^Subject:" nil t) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
534 (progn (skip-chars-forward " \t") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
535 (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
|
536 (progn (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
|
537 (point)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
538 (re-search-forward "[\n][\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
|
539 (buffer-substring (point) (progn (end-of-line) (point)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
540 "\n")) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
541 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
542 ;; 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
|
543 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
544 (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
|
545 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
546 (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
|
547 ;; 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
|
548 (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
|
549 (forward-line -1)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
550 (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
|
551 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
552 (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
|
553 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
554 (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
|
555 ;; 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
|
556 (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
|
557 (forward-line -1)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
558 (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
|
559 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
560 (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
|
561 "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
|
562 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
|
563 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
|
564 (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
|
565 (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
|
566 (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
|
567 (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
|
568 (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
|
569 (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
|
570 (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
|
571 (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
|
572 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
|
573 (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
|
574 (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
|
575 (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
|
576 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
577 (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
|
578 "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
|
579 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
|
580 non-deleted messages." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
581 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
582 (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
|
583 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
584 (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
|
585 "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
|
586 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
|
587 (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
|
588 (let (msg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
589 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
590 (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
|
591 (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
|
592 (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
|
593 (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
|
594 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
595 (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
|
596 "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
|
597 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
|
598 (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
|
599 (let (msg) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
600 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
601 (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
|
602 (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
|
603 (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
|
604 (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
|
605 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
606 (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
|
607 "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
|
608 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
|
609 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
|
610 (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
|
611 (let ((forward (> n 0)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
612 search-regexp i found) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
613 (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
|
614 (setq search-regexp (pmail-current-subject-regexp) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
615 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
|
616 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
617 (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
|
618 (if forward |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
619 (not (eobp)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
620 (not (bobp)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
621 (let (done) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
622 (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
|
623 (if forward |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
624 (not (eobp)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
625 (not (bobp)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
626 ;; 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
|
627 (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
|
628 ;; 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
|
629 (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
|
630 (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
|
631 (min (point-max) (+ 6 (point)))))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
632 ;; See if that msg has desired subject. |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
633 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
634 (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
|
635 (save-restriction |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
636 (widen) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
637 (goto-char (pmail-msgbeg i)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
638 (search-forward "\n*** EOOH ***\n") |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
639 (let ((beg (point)) end) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
640 (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
|
641 (setq end (point)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
642 (goto-char beg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
643 (setq done (re-search-forward search-regexp end t)))))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
644 (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
|
645 (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
|
646 (if found |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
647 (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
|
648 (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
|
649 (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
|
650 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
651 (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
|
652 "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
|
653 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
|
654 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
|
655 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
656 (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
|
657 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
658 ;; 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
|
659 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
660 (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
|
661 "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
|
662 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
|
663 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
|
664 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
|
665 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
666 (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
|
667 (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
|
668 (backward (< count 0))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
669 (while (/= count 0) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
670 (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
|
671 (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
|
672 (pmail-delete-message) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
673 (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
|
674 (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
|
675 (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
|
676 (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
|
677 (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
|
678 (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
|
679 ;; 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
|
680 (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
|
681 (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
|
682 (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
|
683 (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
|
684 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
685 (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
|
686 "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
|
687 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
|
688 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
|
689 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
|
690 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
691 (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
|
692 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
693 (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
|
694 ;; 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
|
695 (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
|
696 (or (eobp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
697 (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
|
698 (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
|
699 (skip-chars-forward " ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
700 (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
|
701 (if undel |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
702 (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
|
703 (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
|
704 (delete-char 1) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
705 (insert "D")))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
706 (beginning-of-line)) |
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-undeleted (n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
709 (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
|
710 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
711 (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
|
712 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
713 (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
|
714 (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
|
715 (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
|
716 (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
|
717 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
718 (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
|
719 "Undelete current message. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
720 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
|
721 (interactive "p") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
722 (if (/= arg 1) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
723 (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
|
724 (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
|
725 (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
|
726 (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
|
727 (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
|
728 (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
|
729 (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
|
730 (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
|
731 (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
|
732 (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
|
733 (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
|
734 (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
|
735 (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
|
736 (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
|
737 (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
|
738 (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
|
739 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
740 (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
|
741 "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
|
742 (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
|
743 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
744 (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
|
745 (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
|
746 (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
|
747 (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
|
748 (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
|
749 (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
|
750 (< 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
|
751 (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
|
752 (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
|
753 (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
|
754 (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
|
755 (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
|
756 (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
|
757 (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
|
758 (< 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
|
759 (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
|
760 (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
|
761 (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
|
762 (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
|
763 (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
|
764 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
765 ;; 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
|
766 (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
|
767 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
768 (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
|
769 "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
|
770 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
|
771 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
|
772 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
773 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
|
774 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
|
775 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
|
776 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
777 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
|
778 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
779 \\[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
|
780 \\[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
|
781 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
782 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
|
783 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
784 \\[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
|
785 \\[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
|
786 \\[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
|
787 \\[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
|
788 \\[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
|
789 \\[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
|
790 \\[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
|
791 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
792 (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
|
793 (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
|
794 (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
|
795 (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
|
796 (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
|
797 (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
|
798 (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
|
799 (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
|
800 (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
|
801 (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
|
802 (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
|
803 (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
|
804 (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
|
805 (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
|
806 (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
|
807 (pmail-summary-enable) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
808 (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
|
809 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
810 ;; 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
|
811 (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
|
812 (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
|
813 (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
|
814 (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
|
815 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
816 (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
|
817 (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
|
818 (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
|
819 (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
|
820 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
821 (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
|
822 "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
|
823 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
|
824 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
|
825 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
|
826 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
|
827 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
828 ;; 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
|
829 ;; 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
|
830 ;; 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
|
831 (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
|
832 (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
|
833 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
834 ;; 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
|
835 (if (eobp) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
836 (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
|
837 (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
838 (skip-chars-forward " ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
839 (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
|
840 (point) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
841 (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
|
842 (point)))))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
843 ;; 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
|
844 ;; 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
|
845 ;; 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
|
846 (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
|
847 (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
|
848 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
849 (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
|
850 (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
|
851 (owin (selected-window))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
852 (if isearch-mode |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
853 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
854 (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
|
855 ;; 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
|
856 ;; 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
|
857 ;; 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
|
858 (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
|
859 (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
|
860 pmail-current-message)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
861 ;; 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
|
862 ;; 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
|
863 (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
|
864 (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
|
865 (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
|
866 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
867 ;; 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
|
868 (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
|
869 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
870 ;; 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
|
871 (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
|
872 (progn |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
873 (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
|
874 (insert " "))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
875 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
876 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
877 ;; 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
|
878 ;; 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
|
879 (unwind-protect |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
880 (progn |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
881 (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
|
882 (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
|
883 (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
|
884 (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
|
885 (save-excursion |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
886 (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
|
887 (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
|
888 (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
|
889 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
890 (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
|
891 "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
|
892 (interactive) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
893 (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
|
894 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
895 (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
|
896 (save-buffer)))) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
897 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
898 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
899 (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
|
900 nil |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
901 (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
|
902 (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
|
903 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
904 (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
|
905 (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
|
906 (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
|
907 (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
|
908 (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
|
909 (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
|
910 (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
|
911 (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
|
912 (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
|
913 (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
|
914 (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
|
915 (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
|
916 (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
|
917 (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
|
918 (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
|
919 (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
|
920 (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
|
921 (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
|
922 (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
|
923 (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
|
924 (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
|
925 (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
|
926 (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
|
927 (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
|
928 (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
|
929 (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
|
930 (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
|
931 (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
|
932 (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
|
933 (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
|
934 (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
|
935 (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
|
936 (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
|
937 (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
|
938 (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
|
939 (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
|
940 (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
|
941 (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
|
942 (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
|
943 (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
|
944 (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
|
945 (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
|
946 (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
|
947 (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
|
948 (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
|
949 (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
|
950 (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
|
951 (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
|
952 (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
|
953 (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
|
954 '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
|
955 (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
|
956 '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
|
957 (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
|
958 '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
|
959 (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
|
960 '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
|
961 (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
|
962 '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
|
963 (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
|
964 '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
|
965 (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
|
966 '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
|
967 (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
|
968 ) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
969 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
970 ;;; 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
|
971 |
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 [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
|
973 |
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 [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
|
975 (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
|
976 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
977 (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
|
978 '("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
|
979 |
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 [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
|
981 '("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
|
982 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
983 (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
|
984 '(nil)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
985 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
986 (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
|
987 '(nil)) |
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 output-body] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
990 '("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
|
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-inbox] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
993 '("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
|
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 output] |
100378
35a95343bc0c
All callers to pmail-output-to-pmail-file changed to
Chong Yidong <cyd@stupidchicken.com>
parents:
100291
diff
changeset
|
996 '("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
|
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 kill-label] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
999 '("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
|
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 add-label] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1002 '("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
|
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 summary] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1005 (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
|
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 summary senders] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1008 '("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
|
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 summary labels] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1011 '("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
|
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 summary recipients] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1014 '("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
|
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 summary topic] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1017 '("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
|
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 regexp] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1020 '("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
|
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 all] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1023 '("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
|
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 mail] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1026 (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
|
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 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
|
1029 '("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
|
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 mail lambda] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1032 '("----")) |
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 mail continue] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1035 '("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
|
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 mail resend] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1038 '("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
|
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 forward] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1041 '("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
|
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 retry] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1044 '("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
|
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 reply] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1047 '("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
|
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 mail] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1050 '("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
|
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 delete] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1053 (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
|
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 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
|
1056 '("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
|
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 delete expunge] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1059 '("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
|
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 delete undelete] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1062 '("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
|
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 delete delete] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1065 '("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
|
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 move] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1068 (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
|
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 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
|
1071 '("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
|
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 move search] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1074 '("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
|
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 move previous] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1077 '("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
|
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 move next] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1080 '("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
|
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 last] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1083 '("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
|
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 first] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1086 '("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
|
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 previous] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1089 '("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
|
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 next] |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1092 '("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
|
1093 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1094 (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
|
1095 "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
|
1096 (interactive "@e") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1097 (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
|
1098 (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
|
1099 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1100 (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
|
1101 "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
|
1102 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
|
1103 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
|
1104 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1105 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
|
1106 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
|
1107 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1108 (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
|
1109 (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
|
1110 (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1111 (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
|
1112 (buf pmail-buffer) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1113 (cur (point)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1114 message-not-found |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1115 (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
|
1116 (buffer-substring (point) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1117 (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
|
1118 (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
|
1119 ;; 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
|
1120 ;; 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
|
1121 ;; 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
|
1122 ;; 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
|
1123 (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
|
1124 (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
|
1125 (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
|
1126 (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
|
1127 (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
|
1128 (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
|
1129 (> total 0)) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1130 (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
|
1131 (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
|
1132 (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
|
1133 (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
|
1134 (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
|
1135 (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
|
1136 (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
|
1137 (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
|
1138 (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
|
1139 (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1140 (skip-chars-forward " ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1141 (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
|
1142 (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
|
1143 (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
|
1144 (delete-char 1) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1145 (insert " ")))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1146 (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
|
1147 (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1148 (if skip-pmail |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1149 nil |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1150 (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
|
1151 (unwind-protect |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1152 (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
|
1153 (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
|
1154 (select-window selwin) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1155 ;; 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
|
1156 (set-buffer obuf)))))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1157 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1158 ;; 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
|
1159 ;; 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
|
1160 ;; 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
|
1161 (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
|
1162 ;; 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
|
1163 (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
|
1164 (progn |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1165 (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
|
1166 (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
|
1167 ;; 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
|
1168 ;; 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
|
1169 (if not-found |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1170 (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
|
1171 (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
|
1172 (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
|
1173 (skip-chars-forward " ") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1174 (point)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1175 (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
|
1176 (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
|
1177 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1178 (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
|
1179 "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
|
1180 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
|
1181 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
|
1182 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1183 (if (eq dist '-) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1184 (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
|
1185 (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
|
1186 (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
|
1187 (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
|
1188 (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
|
1189 (prog1 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1190 ;; 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
|
1191 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1192 (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
|
1193 (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
|
1194 (end-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1195 (eobp))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1196 (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
|
1197 (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
|
1198 (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
|
1199 (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
|
1200 (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
|
1201 (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
|
1202 ;; 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
|
1203 (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
|
1204 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1205 (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
|
1206 "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
|
1207 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
|
1208 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
|
1209 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1210 (if (eq dist '-) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1211 (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
|
1212 (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
|
1213 (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
|
1214 (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
|
1215 (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
|
1216 (prog1 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1217 ;; 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
|
1218 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1219 (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
|
1220 (beginning-of-line) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1221 (bobp)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1222 (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
|
1223 (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
|
1224 (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
|
1225 (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
|
1226 (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
|
1227 (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
|
1228 ;; 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
|
1229 (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
|
1230 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1231 (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
|
1232 "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
|
1233 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1234 (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
|
1235 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1236 (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
|
1237 "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
|
1238 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1239 (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
|
1240 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1241 (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
|
1242 "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
|
1243 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
|
1244 (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
|
1245 ;; 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
|
1246 (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
|
1247 (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
|
1248 (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
|
1249 (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
|
1250 ;; 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
|
1251 ;; 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
|
1252 (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
|
1253 (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
|
1254 (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
|
1255 (cond |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1256 ((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
|
1257 (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
|
1258 (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
|
1259 ((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
|
1260 (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
|
1261 (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
|
1262 ) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1263 (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
|
1264 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1265 (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
|
1266 "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
|
1267 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1268 (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
|
1269 (let (window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1270 (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
|
1271 (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
|
1272 (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
|
1273 (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
|
1274 (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
|
1275 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1276 (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
|
1277 "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
|
1278 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1279 (pmail-summary-wipe) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1280 (pmail-quit)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1281 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1282 (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
|
1283 "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
|
1284 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1285 (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
|
1286 (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
|
1287 (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
|
1288 ;; 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
|
1289 (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
|
1290 (delete-window)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1291 ;; 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
|
1292 (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
|
1293 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1294 (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
|
1295 "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
|
1296 (interactive) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1297 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1298 (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
|
1299 (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
|
1300 (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
|
1301 (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
|
1302 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1303 (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
|
1304 "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
|
1305 (interactive) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1306 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1307 (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
|
1308 (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
|
1309 (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
|
1310 (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
|
1311 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1312 (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
|
1313 (save-buffer)) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1314 (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
|
1315 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1316 (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
|
1317 "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
|
1318 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1319 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
|
1320 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
|
1321 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
|
1322 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
|
1323 (interactive |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1324 (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
|
1325 (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
|
1326 (let (msg) |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1327 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1328 (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
|
1329 (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
|
1330 ;; 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
|
1331 (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
|
1332 ;; 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
|
1333 (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
|
1334 (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
|
1335 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1336 (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
|
1337 "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
|
1338 (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
|
1339 ;; 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
|
1340 (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
|
1341 (pmail filename)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1342 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1343 (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
|
1344 "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
|
1345 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1346 (with-no-warnings |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1347 (beginning-of-buffer))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1348 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1349 (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
|
1350 "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
|
1351 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1352 (with-no-warnings |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1353 (end-of-buffer)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1354 (forward-line -1)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1355 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1356 (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
|
1357 (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
|
1358 (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
|
1359 (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
|
1360 (declare-function pmail-output-read-pmail-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
|
1361 (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
|
1362 |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1363 (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
|
1364 (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
|
1365 nil |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1366 (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
|
1367 (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
|
1368 (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
|
1369 (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
|
1370 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1371 (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
|
1372 "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
|
1373 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1374 (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
|
1375 (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
|
1376 (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
|
1377 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1378 (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
|
1379 "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
|
1380 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1381 (pmail-cease-edit) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1382 (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
|
1383 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1384 (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
|
1385 "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
|
1386 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
|
1387 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1388 (pmail-abort-edit) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1389 (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
|
1390 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1391 (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
|
1392 "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
|
1393 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
|
1394 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
|
1395 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
|
1396 (interactive |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1397 (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
|
1398 (prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1399 (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
|
1400 regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1401 (setq prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1402 (concat prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1403 (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
|
1404 (concat ", default " |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1405 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
|
1406 "): "))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1407 (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
|
1408 (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
|
1409 (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
|
1410 ((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
|
1411 (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
|
1412 (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
|
1413 (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
|
1414 ;; 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
|
1415 ;; 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
|
1416 (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
|
1417 (unwind-protect |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1418 (progn |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1419 (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
|
1420 (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
|
1421 (set-buffer buffer)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1422 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1423 (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
|
1424 "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
|
1425 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
|
1426 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
|
1427 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
|
1428 (interactive |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1429 (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
|
1430 (prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1431 (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
|
1432 regexp) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1433 (setq prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1434 (concat prompt |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1435 (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
|
1436 (concat ", default " |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1437 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
|
1438 "): "))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1439 (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
|
1440 (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
|
1441 (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
|
1442 ((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
|
1443 (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
|
1444 (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
|
1445 (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
|
1446 ;; 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
|
1447 ;; 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
|
1448 (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
|
1449 (unwind-protect |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1450 (progn |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1451 (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
|
1452 (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
|
1453 (set-buffer buffer)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1454 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1455 (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
|
1456 "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
|
1457 (interactive) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1458 (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
|
1459 (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
|
1460 (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
|
1461 ;; 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
|
1462 ;; 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
|
1463 (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
|
1464 (if window |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1465 ;; 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
|
1466 (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
|
1467 (unwind-protect |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1468 (progn |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1469 (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
|
1470 (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
|
1471 (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
|
1472 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1473 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1474 (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
|
1475 "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
|
1476 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
|
1477 (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
|
1478 (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
|
1479 (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
|
1480 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1481 (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
|
1482 (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
|
1483 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1484 (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
|
1485 "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
|
1486 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
|
1487 (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
|
1488 (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
|
1489 (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
|
1490 (save-excursion |
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1491 (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
|
1492 (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
|
1493 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1494 ;;;; *** 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
|
1495 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1496 (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
|
1497 "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
|
1498 (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
|
1499 (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
|
1500 (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
|
1501 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1502 (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
|
1503 "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
|
1504 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
|
1505 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
|
1506 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1507 (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
|
1508 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1509 (select-window window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1510 (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
|
1511 (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
|
1512 (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
|
1513 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1514 (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
|
1515 "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
|
1516 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1517 (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
|
1518 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1519 (select-window window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1520 (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
|
1521 (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
|
1522 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1523 (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
|
1524 "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
|
1525 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
|
1526 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
|
1527 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
|
1528 (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
|
1529 (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
|
1530 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1531 (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
|
1532 (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
|
1533 (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
|
1534 (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
|
1535 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1536 (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
|
1537 "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
|
1538 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
|
1539 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
|
1540 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1541 (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
|
1542 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1543 (select-window window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1544 (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
|
1545 (pmail-retry-failure) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1546 (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
|
1547 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1548 (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
|
1549 "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
|
1550 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1551 (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
|
1552 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1553 (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
|
1554 "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
|
1555 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
|
1556 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
|
1557 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1558 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1559 (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
|
1560 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1561 (select-window window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1562 (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
|
1563 (pmail-forward resend) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1564 (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
|
1565 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1566 (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
|
1567 "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
|
1568 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1569 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1570 (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
|
1571 (if window |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1572 (select-window window) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1573 (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
|
1574 (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
|
1575 |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1576 ;; 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
|
1577 |
100378
35a95343bc0c
All callers to pmail-output-to-pmail-file changed to
Chong Yidong <cyd@stupidchicken.com>
parents:
100291
diff
changeset
|
1578 (defun pmail-summary-output-to-babyl-file (&optional file-name n) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1579 "Append the current message to an Pmail file named FILE-NAME. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1580 If the file does not exist, ask if it should be created. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1581 If file is being visited, the message is appended to the Emacs |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1582 buffer visiting that file. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1583 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1584 A prefix argument N says to output N consecutive messages |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1585 starting with the current one. Deleted messages are skipped and don't count." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1586 (interactive |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1587 (progn (require 'pmailout) |
98526
276fe938ccc2
Next step in the Rmail/mbox support: getting basic summary support working.
Paul Reilly <pmr@pajato.com>
parents:
98019
diff
changeset
|
1588 (list (pmail-output-read-pmail-file-name) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1589 (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
|
1590 (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
|
1591 (while |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1592 (and (< i n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1593 (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
|
1594 (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
|
1595 (setq prev-msg |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1596 (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
|
1597 pmail-current-message)))))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1598 (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
|
1599 (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
|
1600 (let ((pmail-delete-after-output nil)) |
100378
35a95343bc0c
All callers to pmail-output-to-pmail-file changed to
Chong Yidong <cyd@stupidchicken.com>
parents:
100291
diff
changeset
|
1601 (pmail-output-to-babyl-file file-name 1))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1602 (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
|
1603 (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
|
1604 (if (< i n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1605 (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
|
1606 |
100378
35a95343bc0c
All callers to pmail-output-to-pmail-file changed to
Chong Yidong <cyd@stupidchicken.com>
parents:
100291
diff
changeset
|
1607 (defalias 'pmail-summary-output-to-pmail-file |
35a95343bc0c
All callers to pmail-output-to-pmail-file changed to
Chong Yidong <cyd@stupidchicken.com>
parents:
100291
diff
changeset
|
1608 'pmail-summary-output-to-babyl-file) |
35a95343bc0c
All callers to pmail-output-to-pmail-file changed to
Chong Yidong <cyd@stupidchicken.com>
parents:
100291
diff
changeset
|
1609 |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1610 (defun pmail-summary-output (&optional file-name n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1611 "Append this message to Unix mail file named FILE-NAME. |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1612 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1613 A prefix argument N says to output N consecutive messages |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1614 starting with the current one. Deleted messages are skipped and don't count." |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1615 (interactive |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1616 (progn (require 'pmailout) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1617 (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
|
1618 (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
|
1619 (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
|
1620 (while |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1621 (and (< i n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1622 (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
|
1623 (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
|
1624 (setq prev-msg |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1625 (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
|
1626 pmail-current-message)))))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1627 (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
|
1628 (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
|
1629 (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
|
1630 (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
|
1631 (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
|
1632 (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
|
1633 (if (< i n) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1634 (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
|
1635 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1636 (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
|
1637 "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
|
1638 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
|
1639 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
|
1640 `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
|
1641 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1642 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1643 (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
|
1644 (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
|
1645 (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
|
1646 (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
|
1647 (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
|
1648 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1649 (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
|
1650 (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
|
1651 (if files |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1652 (progn |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1653 (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
|
1654 (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
|
1655 (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
|
1656 files |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1657 'pmail-summary-input))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1658 (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
|
1659 (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
|
1660 (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
|
1661 files |
100378
35a95343bc0c
All callers to pmail-output-to-pmail-file changed to
Chong Yidong <cyd@stupidchicken.com>
parents:
100291
diff
changeset
|
1662 'pmail-summary-output-to-babyl-file)))) |
97528
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1663 (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
|
1664 '("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
|
1665 (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
|
1666 '("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
|
1667 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1668 (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
|
1669 "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
|
1670 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
|
1671 (interactive) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1672 (save-excursion |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1673 (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
|
1674 (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
|
1675 (if file-name |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1676 (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
|
1677 (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
|
1678 (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
|
1679 (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
|
1680 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1681 ;; 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
|
1682 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1683 (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
|
1684 "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
|
1685 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
|
1686 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1687 (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
|
1688 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1689 (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
|
1690 "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
|
1691 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
|
1692 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1693 (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
|
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-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
|
1696 "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
|
1697 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
|
1698 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1699 (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
|
1700 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1701 (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
|
1702 "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
|
1703 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
|
1704 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1705 (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
|
1706 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1707 (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
|
1708 "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
|
1709 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
|
1710 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1711 (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
|
1712 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1713 (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
|
1714 "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
|
1715 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
|
1716 (interactive "P") |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1717 (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
|
1718 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1719 (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
|
1720 "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
|
1721 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
|
1722 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
|
1723 (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
|
1724 (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
|
1725 (function (lambda (reverse) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1726 (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
|
1727 reverse)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1728 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1729 (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
|
1730 "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
|
1731 (require 'pmailsort) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1732 (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
|
1733 (unwind-protect |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1734 (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
|
1735 (funcall sortfun reverse)) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1736 (select-window selwin)))) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1737 |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1738 (provide 'pmailsum) |
184bb2071e3f
mail/: Add new (temporary) libaries for which to test Rmail/mbox such
Paul Reilly <pmr@pajato.com>
parents:
diff
changeset
|
1739 |
100655
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
1740 ;; Local Variables: |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
1741 ;; change-log-default-name: "ChangeLog.pmail" |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
1742 ;; End: |
4f54978ec0c5
(pmail-message-subject-p): Mark as broken.
Richard M. Stallman <rms@gnu.org>
parents:
100378
diff
changeset
|
1743 |
97533 | 1744 ;; 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
|
1745 ;;; pmailsum.el ends here |