annotate lisp/mail/pmailsum.el @ 99481:54d148d6078b

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