annotate lisp/mail/rmailsum.el @ 4100:f8c6e5e9603f

(Fbuffer_local_variables): For local var that is unbound, put just the symbol in the result, not a cons of (symbol . value).
author Richard M. Stallman <rms@gnu.org>
date Thu, 15 Jul 1993 05:36:59 +0000
parents b8c99f30ca3f
children 8f5a44af0114
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2233
fb0ed5a1d0f3 Add standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2232
diff changeset
1 ;;; rmailsum.el --- make summary buffers for the mail reader
2232
4f9d60f7de9d Add standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2164
diff changeset
2
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
3 ;; Copyright (C) 1985, 1993 Free Software Foundation, Inc.
845
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 814
diff changeset
4
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 658
diff changeset
5 ;; Maintainer: FSF
814
38b2499cb3e9 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
6 ;; Keywords: mail
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 658
diff changeset
7
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 658
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;; any later version.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;; GNU General Public License for more details.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23
2232
4f9d60f7de9d Add standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2164
diff changeset
24 ;;; Commentary:
4f9d60f7de9d Add standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2164
diff changeset
25
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
26 ;; Extended by Bob Weiner of Motorola
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
27 ;; Provided all commands from rmail-mode in rmail-summary-mode and made key
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
28 ;; bindings in both modes wholly compatible.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
29
2232
4f9d60f7de9d Add standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2164
diff changeset
30 ;;; Code:
4f9d60f7de9d Add standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 2164
diff changeset
31
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
32 ;; Entry points for making a summary buffer.
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
34 ;; Regenerate the contents of the summary
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
35 ;; using the same selection criterion as last time.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
36 ;; M-x revert-buffer in a summary buffer calls this function.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
37 (defun rmail-update-summary (&rest ignore)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
38 (apply (car rmail-summary-redo) (cdr rmail-summary-redo)))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 (defun rmail-summary ()
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 "Display a summary of all messages, one line per message."
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 (interactive)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
43 (rmail-new-summary "All" '(rmail-summary) nil))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 (defun rmail-summary-by-labels (labels)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 "Display a summary of all messages with one or more LABELS.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 LABELS should be a string containing the desired labels, separated by commas."
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 (interactive "sLabels to summarize by: ")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 (if (string= labels "")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 (setq labels (or rmail-last-multi-labels
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 (error "No label specified"))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 (setq rmail-last-multi-labels labels)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 (rmail-new-summary (concat "labels " labels)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
54 (list 'rmail-summary-by-labels labels)
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 'rmail-message-labels-p
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 (concat ", \\(" (mail-comma-list-regexp labels) "\\),")))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 (defun rmail-summary-by-recipients (recipients &optional primary-only)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 "Display a summary of all messages with the given RECIPIENTS.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 Normally checks the To, From and Cc fields of headers;
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 but if PRIMARY-ONLY is non-nil (prefix arg given),
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 only look in the To and From fields.
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
63 RECIPIENTS is a string of regexps separated by commas."
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 (interactive "sRecipients to summarize by: \nP")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 (rmail-new-summary
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 (concat "recipients " recipients)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
67 (list 'rmail-summary-by-recipients recipients primary-only)
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 'rmail-message-recipients-p
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 (mail-comma-list-regexp recipients) primary-only))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71 (defun rmail-summary-by-regexp (regexp)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 "Display a summary of all messages according to regexp REGEXP.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 If the regular expression is found in the header of the message
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 \(including in the date and other lines, as well as the subject line),
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 Emacs will list the header line in the RMAIL-summary."
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 (interactive "sRegexp to summarize by: ")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 (if (string= regexp "")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 (setq regexp (or rmail-last-regexp
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
79 (error "No regexp specified."))))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 (setq rmail-last-regexp regexp)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 (rmail-new-summary (concat "regexp " regexp)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
82 (list 'rmail-summary-by-regexp regexp)
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 'rmail-message-regexp-p
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 regexp))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
86 ;; rmail-summary-by-topic
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
87 ;; 1989 R.A. Schnitzler
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
88
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
89 (defun rmail-summary-by-topic (subject &optional whole-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
90 "Display a summary of all messages with the given SUBJECT.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
91 Normally checks the Subject field of headers;
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
92 but if WHOLE-MESSAGE is non-nil (prefix arg given),
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
93 look in the whole message.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
94 SUBJECT is a string of regexps separated by commas."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
95 (interactive "sTopics to summarize by: \nP")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
96 (rmail-new-summary
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
97 (concat "about " subject)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
98 (list 'rmail-summary-by-topic subject whole-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
99 'rmail-message-subject-p
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
100 (mail-comma-list-regexp subject) whole-message))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
101
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
102 (defun rmail-message-subject-p (msg subject &optional whole-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
103 (save-restriction
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
104 (goto-char (rmail-msgbeg msg))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
105 (search-forward "\n*** EOOH ***\n")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
106 (narrow-to-region
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
107 (point)
3349
31390246a7a2 (rmail-message-subject-p): Fix typo in string constant.
Richard M. Stallman <rms@gnu.org>
parents: 3198
diff changeset
108 (progn (search-forward (if whole-message "\^_" "\n\n")) (point)))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
109 (goto-char (point-min))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
110 (if whole-message (re-search-forward subject nil t)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
111 (string-match subject (or (mail-fetch-field "Subject") "")) )))
3443
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
112
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
113 (defun rmail-summary-by-senders (senders)
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
114 "Display a summary of all messages with the given SENDERS.
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
115 SENDERS is a string of names separated by commas."
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
116 (interactive "sSenders to summarize by: ")
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
117 (rmail-new-summary
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
118 (concat "senders " senders)
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
119 'rmail-message-senders-p
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
120 (mail-comma-list-regexp senders)))
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
121
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
122 (defun rmail-message-senders-p (msg senders)
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
123 (save-restriction
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
124 (goto-char (rmail-msgbeg msg))
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
125 (search-forward "\n*** EOOH ***\n")
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
126 (narrow-to-region (point) (progn (search-forward "\n\n") (point)))
7a15b35366f8 (rmail-summary-by-senders): New function.
Richard M. Stallman <rms@gnu.org>
parents: 3349
diff changeset
127 (string-match senders (or (mail-fetch-field "From") ""))))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
129 ;; General making of a summary buffer.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
130
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
131 (defvar rmail-summary-symbol-number 0)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
132
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
133 (defun rmail-new-summary (description redo-form function &rest args)
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 "Create a summary of selected messages.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 DESCRIPTION makes part of the mode line of the summary buffer.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 For each message, FUNCTION is applied to the message number and ARGS...
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 and if the result is non-nil, that message is included.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138 nil for FUNCTION means all messages."
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 (message "Computing summary lines...")
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
140 (let (sumbuf mesg was-in-summary)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
141 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
142 ;; Go to the Rmail buffer.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
143 (if (eq major-mode 'rmail-summary-mode)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
144 (progn
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
145 (setq was-in-summary t)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
146 (set-buffer rmail-buffer)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
147 ;; Find its summary buffer, or make one.
3198
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
148 (setq sumbuf
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
149 (if (and rmail-summary-buffer
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
150 (buffer-name rmail-summary-buffer))
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
151 rmail-summary-buffer
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
152 (generate-new-buffer (concat (buffer-name) "-summary"))))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
153 (setq mesg rmail-current-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
154 ;; Filter the messages; make or get their summary lines.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
155 (let ((summary-msgs ())
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
156 (new-summary-line-count 0))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
157 (let ((msgnum 1)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
158 (buffer-read-only nil))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
159 (save-restriction
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
160 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
161 (widen)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
162 (goto-char (point-min))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
163 (while (>= rmail-total-messages msgnum)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
164 (if (or (null function)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
165 (apply function (cons msgnum args)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
166 (setq summary-msgs
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
167 (cons (cons msgnum (rmail-make-summary-line msgnum))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
168 summary-msgs)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
169 (setq msgnum (1+ msgnum)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
170 (setq summary-msgs (nreverse summary-msgs)))))
3198
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
171 ;; Temporarily, while summary buffer is unfinished,
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
172 ;; we "don't have" a summary.
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
173 (setq rmail-summary-buffer nil)
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
174 (save-excursion
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
175 (let ((rbuf (current-buffer))
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
176 (total rmail-total-messages))
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
177 (set-buffer sumbuf)
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
178 ;; Set up the summary buffer's contents.
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
179 (let ((buffer-read-only nil))
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
180 (erase-buffer)
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
181 (while summary-msgs
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
182 (princ (cdr (car summary-msgs)) sumbuf)
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
183 (setq summary-msgs (cdr summary-msgs)))
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
184 (goto-char (point-min)))
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
185 ;; Set up the rest of its state and local variables.
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
186 (setq buffer-read-only t)
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
187 (rmail-summary-mode)
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
188 (make-local-variable 'minor-mode-alist)
3466
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
189 (setq minor-mode-alist (list '(t (concat ": " description))))
3198
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
190 (setq rmail-buffer rbuf
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
191 rmail-summary-redo redo-form
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
192 rmail-total-messages total))))
18612999f80c (rmail-new-summary): Set rmail-summary-buffer
Richard M. Stallman <rms@gnu.org>
parents: 3100
diff changeset
193 (setq rmail-summary-buffer sumbuf))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
194 ;; Now display the summary buffer and go to the right place in it.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
195 (or was-in-summary
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
196 (pop-to-buffer sumbuf))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
197 (rmail-summary-goto-msg mesg t t)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
198 (message "Computing summary lines...done")))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
199
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
200 ;; Low levels of generating a summary.
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
201
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202 (defun rmail-make-summary-line (msg)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 (let ((line (or (aref rmail-summary-vector (1- msg))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204 (progn
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205 (setq new-summary-line-count
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
206 (1+ new-summary-line-count))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
207 (if (zerop (% new-summary-line-count 10))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
208 (message "Computing summary lines...%d"
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209 new-summary-line-count))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
210 (rmail-make-summary-line-1 msg)))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
211 ;; Fix up the part of the summary that says "deleted" or "unseen".
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212 (aset line 4
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213 (if (rmail-message-deleted-p msg) ?\D
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
214 (if (= ?0 (char-after (+ 3 (rmail-msgbeg msg))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
215 ?\- ?\ )))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
216 line))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
217
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
218 (defun rmail-make-summary-line-1 (msg)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219 (goto-char (rmail-msgbeg msg))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
220 (let* ((lim (save-excursion (forward-line 2) (point)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
221 pos
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222 (labels
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
223 (progn
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
224 (forward-char 3)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
225 (concat
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
226 ; (if (save-excursion (re-search-forward ",answered," lim t))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
227 ; "*" "")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
228 ; (if (save-excursion (re-search-forward ",filed," lim t))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
229 ; "!" "")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230 (if (progn (search-forward ",,") (eolp))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
231 ""
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
232 (concat "{"
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
233 (buffer-substring (point)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
234 (progn (end-of-line) (point)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
235 "} ")))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236 (line
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
237 (progn
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
238 (forward-line 1)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
239 (if (looking-at "Summary-line: ")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
240 (progn
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
241 (goto-char (match-end 0))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
242 (setq line
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
243 (buffer-substring (point)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
244 (progn (forward-line 1) (point)))))))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
245 ;; Obsolete status lines lacking a # should be flushed.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
246 (and line
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
247 (not (string-match "#" line))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
248 (progn
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
249 (delete-region (point)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
250 (progn (forward-line -1) (point)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
251 (setq line nil)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
252 ;; If we didn't get a valid status line from the message,
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
253 ;; make a new one and put it in the message.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
254 (or line
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
255 (let* ((case-fold-search t)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
256 (next (rmail-msgend msg))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
257 (beg (if (progn (goto-char (rmail-msgbeg msg))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
258 (search-forward "\n*** EOOH ***\n" next t))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
259 (point)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
260 (forward-line 1)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
261 (point)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 (end (progn (search-forward "\n\n" nil t) (point))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
263 (save-restriction
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
264 (narrow-to-region beg end)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
265 (goto-char beg)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266 (setq line (rmail-make-basic-summary-line)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
267 (goto-char (rmail-msgbeg msg))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
268 (forward-line 2)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
269 (insert "Summary-line: " line)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270 (setq pos (string-match "#" line))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
271 (aset rmail-summary-vector (1- msg)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272 (concat (format "%4d " msg)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
273 (substring line 0 pos)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
274 labels
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
275 (substring line (1+ pos))))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
276
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
277 (defun rmail-make-basic-summary-line ()
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
278 (goto-char (point-min))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
279 (concat (save-excursion
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
280 (if (not (re-search-forward "^Date:" nil t))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
281 " "
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
282 (cond ((re-search-forward "\\([^0-9:]\\)\\([0-3]?[0-9]\\)\\([- \t_]+\\)\\([adfjmnos][aceopu][bcglnprtvy]\\)"
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
283 (save-excursion (end-of-line) (point)) t)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
284 (format "%2d-%3s"
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
285 (string-to-int (buffer-substring
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
286 (match-beginning 2)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
287 (match-end 2)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
288 (buffer-substring
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
289 (match-beginning 4) (match-end 4))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
290 ((re-search-forward "\\([^a-z]\\)\\([adfjmnos][acepou][bcglnprtvy]\\)\\([-a-z \t_]*\\)\\([0-9][0-9]?\\)"
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
291 (save-excursion (end-of-line) (point)) t)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
292 (format "%2d-%3s"
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
293 (string-to-int (buffer-substring
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
294 (match-beginning 4)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
295 (match-end 4)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
296 (buffer-substring
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
297 (match-beginning 2) (match-end 2))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
298 (t "??????"))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
299 " "
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
300 (save-excursion
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
301 (if (not (re-search-forward "^From:[ \t]*" nil t))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
302 " "
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
303 (let* ((from (mail-strip-quoted-names
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
304 (buffer-substring
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
305 (1- (point))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
306 (progn (end-of-line)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307 (skip-chars-backward " \t")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
308 (point)))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309 len mch lo)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
310 (if (string-match (concat "^"
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
311 (regexp-quote (user-login-name))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
312 "\\($\\|@\\)")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313 from)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
314 (save-excursion
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
315 (goto-char (point-min))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316 (if (not (re-search-forward "^To:[ \t]*" nil t))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
317 nil
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
318 (setq from
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
319 (concat "to: "
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
320 (mail-strip-quoted-names
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
321 (buffer-substring
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
322 (point)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
323 (progn (end-of-line)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
324 (skip-chars-backward " \t")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
325 (point)))))))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
326 (setq len (length from))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
327 (setq mch (string-match "[@%]" from))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
328 (format "%25s"
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
329 (if (or (not mch) (<= len 25))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
330 (substring from (max 0 (- len 25)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
331 (substring from
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
332 (setq lo (cond ((< (- mch 9) 0) 0)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
333 ((< len (+ mch 16))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
334 (- len 25))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335 (t (- mch 9))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
336 (min len (+ lo 25))))))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
337 " #"
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
338 (if (re-search-forward "^Subject:" nil t)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
339 (progn (skip-chars-forward " \t")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
340 (buffer-substring (point)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
341 (progn (end-of-line)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
342 (point))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
343 (re-search-forward "[\n][\n]+" nil t)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
344 (buffer-substring (point) (progn (end-of-line) (point))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
345 "\n"))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
346
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
347 ;; Simple motion in a summary buffer.
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
348
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
349 (defun rmail-summary-next-all (&optional number)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
350 (interactive "p")
2164
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
351 (forward-line (if number number 1))
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
352 (display-buffer rmail-buffer))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
353
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
354 (defun rmail-summary-previous-all (&optional number)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
355 (interactive "p")
2164
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
356 (forward-line (- (if number number 1)))
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
357 (display-buffer rmail-buffer))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
358
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
359 (defun rmail-summary-next-msg (&optional number)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
360 "Display next non-deleted msg from rmail file.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
361 With optional prefix argument NUMBER, moves forward this number of non-deleted
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
362 messages, or backward if NUMBER is negative."
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
363 (interactive "p")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
364 (forward-line 0)
3466
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
365 (and (> number 0) (end-of-line))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
366 (let ((count (if (< number 0) (- number) number))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
367 (search (if (> number 0) 're-search-forward 're-search-backward))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
368 (non-del-msg-found nil))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
369 (while (and (> count 0) (setq non-del-msg-found
3509
a1ef317ceb18 (rmail-summary-next-msg): Fix number of dots in regexp.
Richard M. Stallman <rms@gnu.org>
parents: 3466
diff changeset
370 (or (funcall search "^....[^D]" nil t)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
371 non-del-msg-found)))
2164
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
372 (setq count (1- count))))
3466
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
373 (beginning-of-line)
2164
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
374 (display-buffer rmail-buffer))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
375
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
376 (defun rmail-summary-previous-msg (&optional number)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
377 (interactive "p")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
378 (rmail-summary-next-msg (- (if number number 1))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
379
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
380 (defun rmail-summary-next-labeled-message (n labels)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
381 "Show next message with LABEL. Defaults to last labels used.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
382 With prefix argument N moves forward N messages with these labels."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
383 (interactive "p\nsMove to next msg with labels: ")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
384 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
385 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
386 (rmail-next-labeled-message n labels)))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
387
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
388 (defun rmail-summary-previous-labeled-message (n labels)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
389 "Show previous message with LABEL. Defaults to last labels used.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
390 With prefix argument N moves backward N messages with these labels."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
391 (interactive "p\nsMove to previous msg with labels: ")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
392 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
393 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
394 (rmail-previous-labeled-message n labels)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
395
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
396 ;; Delete and undelete summary commands.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
397
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
398 (defun rmail-summary-delete-forward (&optional backward)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
399 "Delete this message and move to next nondeleted one.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
400 Deleted messages stay in the file until the \\[rmail-expunge] command is given.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
401 With prefix argument, delete and move backward."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
402 (interactive "P")
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
403 (let (end)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
404 (rmail-summary-goto-msg)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
405 (pop-to-buffer rmail-buffer)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
406 (rmail-delete-forward backward)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
407 (pop-to-buffer rmail-summary-buffer)))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
408
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
409 (defun rmail-summary-delete-backward ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
410 "Delete this message and move to previous nondeleted one.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
411 Deleted messages stay in the file until the \\[rmail-expunge] command is given."
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
412 (interactive)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
413 (rmail-summary-delete-forward t))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
414
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
415 (defun rmail-summary-mark-deleted (&optional n undel)
3100
eb6ae6faff24 (rmail-summary-mark-deleted): Check for end of buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
416 (and n (rmail-summary-goto-msg n t t))
eb6ae6faff24 (rmail-summary-mark-deleted): Check for end of buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
417 (or (eobp)
eb6ae6faff24 (rmail-summary-mark-deleted): Check for end of buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
418 (let ((buffer-read-only nil))
eb6ae6faff24 (rmail-summary-mark-deleted): Check for end of buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
419 (skip-chars-forward " ")
eb6ae6faff24 (rmail-summary-mark-deleted): Check for end of buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
420 (skip-chars-forward "[0-9]")
eb6ae6faff24 (rmail-summary-mark-deleted): Check for end of buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
421 (if undel
eb6ae6faff24 (rmail-summary-mark-deleted): Check for end of buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
422 (if (looking-at "D")
eb6ae6faff24 (rmail-summary-mark-deleted): Check for end of buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
423 (progn (delete-char 1) (insert " ")))
eb6ae6faff24 (rmail-summary-mark-deleted): Check for end of buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
424 (delete-char 1)
eb6ae6faff24 (rmail-summary-mark-deleted): Check for end of buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2233
diff changeset
425 (insert "D"))))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
426 (beginning-of-line))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
427
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
428 (defun rmail-summary-mark-undeleted (n)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
429 (rmail-summary-mark-deleted n t))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
430
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
431 (defun rmail-summary-deleted-p (&optional n)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
432 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
433 (and n (rmail-summary-goto-msg n nil t))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
434 (skip-chars-forward " ")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
435 (skip-chars-forward "[0-9]")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
436 (looking-at "D")))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
437
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
438 (defun rmail-summary-undelete (&optional arg)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
439 "Undelete current message.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
440 Optional prefix ARG means undelete ARG previous messages."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
441 (interactive "p")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
442 (if (/= arg 1)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
443 (rmail-summary-undelete-many arg)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
444 (let ((buffer-read-only nil))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
445 (end-of-line)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
446 (cond ((re-search-backward "\\(^ *[0-9]*\\)\\(D\\)" nil t)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
447 (replace-match "\\1 ")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
448 (rmail-summary-goto-msg)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
449 (pop-to-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
450 (and (rmail-message-deleted-p rmail-current-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
451 (rmail-undelete-previous-message))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
452 (pop-to-buffer rmail-summary-buffer))))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
453
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
454 (defun rmail-summary-undelete-many (&optional n)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
455 "Undelete all deleted msgs, optional prefix arg N means undelete N prev msgs."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
456 (interactive "P")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
457 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
458 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
459 (let* ((init-msg (if n rmail-current-message rmail-total-messages))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
460 (rmail-current-message init-msg)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
461 (n (or n rmail-total-messages))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
462 (msgs-undeled 0))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
463 (while (and (> rmail-current-message 0)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
464 (< msgs-undeled n))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
465 (if (rmail-message-deleted-p rmail-current-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
466 (progn (rmail-set-attribute "deleted" nil)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
467 (setq msgs-undeled (1+ msgs-undeled))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
468 (setq rmail-current-message (1- rmail-current-message)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
469 (set-buffer rmail-summary-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
470 (setq rmail-current-message init-msg msgs-undeled 0)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
471 (while (and (> rmail-current-message 0)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
472 (< msgs-undeled n))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
473 (if (rmail-summary-deleted-p rmail-current-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
474 (progn (rmail-summary-mark-undeleted rmail-current-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
475 (setq msgs-undeled (1+ msgs-undeled))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
476 (setq rmail-current-message (1- rmail-current-message))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
477 (rmail-summary-goto-msg)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
478
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
479 ;; Rmail Summary mode is suitable only for specially formatted data.
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
480 (put 'rmail-summary-mode 'mode-class 'special)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
481
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
482 (defun rmail-summary-mode ()
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
483 "Rmail Summary Mode is invoked from Rmail Mode by using \\<rmail-mode-map>\\[rmail-summary].
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
484 As commands are issued in the summary buffer, they are applied to the
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
485 corresponding mail messages in the rmail buffer.
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
486
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
487 All normal editing commands are turned off.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
488 Instead, all of the Rmail Mode commands are available, plus:
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
489
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
490 \\[rmail-summary-undelete-many] Undelete all or prefix arg deleted messages."
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
491 (interactive)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
492 (kill-all-local-variables)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
493 (setq major-mode 'rmail-summary-mode)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
494 (setq mode-name "RMAIL Summary")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
495 (use-local-map rmail-summary-mode-map)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
496 (setq truncate-lines t)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
497 (setq buffer-read-only t)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
498 (set-syntax-table text-mode-syntax-table)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
499 (make-local-variable 'rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
500 (make-local-variable 'rmail-total-messages)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
501 (make-local-variable 'rmail-current-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
502 (setq rmail-current-message nil)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
503 (make-local-variable 'rmail-summary-redo)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
504 (setq rmail-summary-redo nil)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
505 (make-local-variable 'revert-buffer-function)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
506 (setq revert-buffer-function 'rmail-update-summary)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
507 (make-local-variable 'post-command-hook)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
508 (add-hook 'post-command-hook 'rmail-summary-rmail-update)
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
509 (run-hooks 'rmail-summary-mode-hook))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
510
2164
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
511 ;; Show in Rmail the message described by the summary line that point is on,
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
512 ;; but only if the Rmail buffer is already visible.
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
513 ;; This is a post-command-hook in summary buffers.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
514 (defun rmail-summary-rmail-update ()
2164
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
515 (if (get-buffer-window rmail-buffer)
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
516 (let (buffer-read-only)
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
517 (save-excursion
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
518 (beginning-of-line)
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
519 (skip-chars-forward " ")
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
520 (let ((beg (point))
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
521 msg-num
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
522 (buf rmail-buffer))
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
523 (skip-chars-forward "0-9")
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
524 (setq msg-num (string-to-int (buffer-substring beg (point))))
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
525 (or (eq rmail-current-message msg-num)
3461
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
526 (let (go-where window (owin (selected-window)))
2164
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
527 (setq rmail-current-message msg-num)
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
528 (if (= (following-char) ?-)
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
529 (progn
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
530 (delete-char 1)
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
531 (insert " ")))
6e276a32aef1 (rmail-summary-next-msg): Call display-buffer.
Richard M. Stallman <rms@gnu.org>
parents: 2077
diff changeset
532 (setq window (display-buffer rmail-buffer))
3461
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
533 ;; Using save-window-excursion caused the new value
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
534 ;; of point to get lost.
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
535 (unwind-protect
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
536 (progn
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
537 (select-window window)
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
538 (rmail-show-message msg-num))
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
539 (select-window owin)))))))))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
540
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
541 (defvar rmail-summary-mode-map nil)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
542
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
543 (if rmail-summary-mode-map
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
544 nil
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
545 (setq rmail-summary-mode-map (make-keymap))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
546 (suppress-keymap rmail-summary-mode-map)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
547 (define-key rmail-summary-mode-map "a" 'rmail-summary-add-label)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
548 (define-key rmail-summary-mode-map "c" 'rmail-summary-continue)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
549 (define-key rmail-summary-mode-map "d" 'rmail-summary-delete-forward)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
550 (define-key rmail-summary-mode-map "\C-d" 'rmail-summary-delete-backward)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
551 (define-key rmail-summary-mode-map "e" 'rmail-summary-edit-current-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
552 (define-key rmail-summary-mode-map "f" 'rmail-summary-forward)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
553 (define-key rmail-summary-mode-map "g" 'rmail-summary-get-new-mail)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
554 (define-key rmail-summary-mode-map "h" 'rmail-summary)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
555 (define-key rmail-summary-mode-map "i" 'rmail-summary-input)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
556 (define-key rmail-summary-mode-map "j" 'rmail-summary-goto-msg)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
557 (define-key rmail-summary-mode-map "k" 'rmail-summary-kill-label)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
558 (define-key rmail-summary-mode-map "l" 'rmail-summary-by-labels)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
559 (define-key rmail-summary-mode-map "\e\C-h" 'rmail-summary)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
560 (define-key rmail-summary-mode-map "\e\C-l" 'rmail-summary-by-labels)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
561 (define-key rmail-summary-mode-map "\e\C-r" 'rmail-summary-by-recipients)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
562 (define-key rmail-summary-mode-map "\e\C-s" 'rmail-summary-by-regexp)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
563 (define-key rmail-summary-mode-map "\e\C-t" 'rmail-summary-by-topic)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
564 (define-key rmail-summary-mode-map "m" 'rmail-summary-mail)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
565 (define-key rmail-summary-mode-map "\M-m" 'rmail-summary-retry-failure)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
566 (define-key rmail-summary-mode-map "n" 'rmail-summary-next-msg)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
567 (define-key rmail-summary-mode-map "\en" 'rmail-summary-next-all)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
568 (define-key rmail-summary-mode-map "\e\C-n" 'rmail-summary-next-labeled-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
569 (define-key rmail-summary-mode-map "o" 'rmail-summary-output-to-rmail-file)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
570 (define-key rmail-summary-mode-map "\C-o" 'rmail-summary-output)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
571 (define-key rmail-summary-mode-map "p" 'rmail-summary-previous-msg)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
572 (define-key rmail-summary-mode-map "\ep" 'rmail-summary-previous-all)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
573 (define-key rmail-summary-mode-map "\e\C-p" 'rmail-summary-previous-labeled-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
574 (define-key rmail-summary-mode-map "q" 'rmail-summary-quit)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
575 (define-key rmail-summary-mode-map "r" 'rmail-summary-reply)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
576 (define-key rmail-summary-mode-map "s" 'rmail-summary-expunge-and-save)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
577 (define-key rmail-summary-mode-map "\es" 'rmail-summary-search)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
578 (define-key rmail-summary-mode-map "t" 'rmail-summary-toggle-header)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
579 (define-key rmail-summary-mode-map "u" 'rmail-summary-undelete)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
580 (define-key rmail-summary-mode-map "\M-u" 'rmail-summary-undelete-many)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
581 (define-key rmail-summary-mode-map "w" 'rmail-summary-wipe)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
582 (define-key rmail-summary-mode-map "x" 'rmail-summary-expunge)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
583 (define-key rmail-summary-mode-map "." 'rmail-summary-beginning-of-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
584 (define-key rmail-summary-mode-map "<" 'rmail-summary-first-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
585 (define-key rmail-summary-mode-map ">" 'rmail-summary-last-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
586 (define-key rmail-summary-mode-map " " 'rmail-summary-scroll-msg-up)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
587 (define-key rmail-summary-mode-map "\177" 'rmail-summary-scroll-msg-down)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
588 (define-key rmail-summary-mode-map "?" 'describe-mode)
3879
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
589 (define-key rmail-summary-mode-map "\C-c\C-s\C-d"
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
590 'rmail-summary-sort-by-date)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
591 (define-key rmail-summary-mode-map "\C-c\C-s\C-s"
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
592 'rmail-summary-sort-by-subject)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
593 (define-key rmail-summary-mode-map "\C-c\C-s\C-a"
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
594 'rmail-summary-sort-by-author)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
595 (define-key rmail-summary-mode-map "\C-c\C-s\C-r"
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
596 'rmail-summary-sort-by-recipient)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
597 (define-key rmail-summary-mode-map "\C-c\C-s\C-c"
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
598 'rmail-summary-sort-by-correspondent)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
599 (define-key rmail-summary-mode-map "\C-c\C-s\C-l"
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
600 'rmail-summary-sort-by-lines)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
601 )
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
602
3862
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
603 ;;; Menu bar bindings.
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
604
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
605 (define-key rmail-summary-mode-map [menu-bar] (make-sparse-keymap))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
606
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
607 (define-key rmail-summary-mode-map [menu-bar classify]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
608 (cons "Classify" (make-sparse-keymap "Classify")))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
609
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
610 (define-key rmail-summary-mode-map [menu-bar classify output-inbox]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
611 '("Output (inbox)" . rmail-summary-output))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
612
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
613 (define-key rmail-summary-mode-map [menu-bar classify output]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
614 '("Output (Rmail)" . rmail-summary-output-to-rmail-file))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
615
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
616 (define-key rmail-summary-mode-map [menu-bar classify kill-label]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
617 '("Kill Label" . rmail-summary-kill-label))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
618
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
619 (define-key rmail-summary-mode-map [menu-bar classify add-label]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
620 '("Add Label" . rmail-summary-add-label))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
621
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
622 (define-key rmail-summary-mode-map [menu-bar summary]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
623 (cons "Summary" (make-sparse-keymap "Summary")))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
624
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
625 (define-key rmail-summary-mode-map [menu-bar summary labels]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
626 '("By Labels" . rmail-summary-by-labels))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
627
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
628 (define-key rmail-summary-mode-map [menu-bar summary recipients]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
629 '("By Recipients" . rmail-summary-by-recipients))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
630
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
631 (define-key rmail-summary-mode-map [menu-bar summary topic]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
632 '("By Topic" . rmail-summary-by-topic))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
633
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
634 (define-key rmail-summary-mode-map [menu-bar summary regexp]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
635 '("By Regexp" . rmail-summary-by-regexp))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
636
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
637 (define-key rmail-summary-mode-map [menu-bar summary all]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
638 '("All" . rmail-summary))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
639
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
640 (define-key rmail-summary-mode-map [menu-bar mail]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
641 (cons "Mail" (make-sparse-keymap "Mail")))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
642
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
643 (define-key rmail-summary-mode-map [menu-bar mail continue]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
644 '("Continue" . rmail-summary-continue))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
645
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
646 (define-key rmail-summary-mode-map [menu-bar mail forward]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
647 '("Forward" . rmail-summary-forward))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
648
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
649 (define-key rmail-summary-mode-map [menu-bar mail retry]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
650 '("Retry" . rmail-summary-retry-failure))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
651
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
652 (define-key rmail-summary-mode-map [menu-bar mail reply]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
653 '("Reply" . rmail-summary-reply))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
654
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
655 (define-key rmail-summary-mode-map [menu-bar mail mail]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
656 '("Mail" . rmail-summary-mail))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
657
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
658 (define-key rmail-summary-mode-map [menu-bar delete]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
659 (cons "Delete" (make-sparse-keymap "Delete")))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
660
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
661 (define-key rmail-summary-mode-map [menu-bar delete expunge/save]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
662 '("Expunge/Save" . rmail-summary-expunge-and-save))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
663
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
664 (define-key rmail-summary-mode-map [menu-bar delete expunge]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
665 '("Expunge" . rmail-summary-expunge))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
666
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
667 (define-key rmail-summary-mode-map [menu-bar delete undelete]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
668 '("Undelete" . rmail-summary-undelete))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
669
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
670 (define-key rmail-summary-mode-map [menu-bar delete delete]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
671 '("Delete" . rmail-summary-delete-forward))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
672
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
673 (define-key rmail-summary-mode-map [menu-bar move]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
674 (cons "Move" (make-sparse-keymap "Move")))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
675
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
676 (define-key rmail-summary-mode-map [menu-bar move search-back]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
677 '("Search Back" . rmail-summary-search-backward))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
678
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
679 (define-key rmail-summary-mode-map [menu-bar move search]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
680 '("Search" . rmail-summary-search))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
681
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
682 (define-key rmail-summary-mode-map [menu-bar move previous]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
683 '("Previous Nondeleted" . rmail-summary-previous-msg))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
684
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
685 (define-key rmail-summary-mode-map [menu-bar move next]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
686 '("Next Nondeleted" . rmail-summary-next-msg))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
687
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
688 (define-key rmail-summary-mode-map [menu-bar move last]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
689 '("Last" . rmail-summary-last-message))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
690
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
691 (define-key rmail-summary-mode-map [menu-bar move first]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
692 '("First" . rmail-summary-first-message))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
693
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
694 (define-key rmail-summary-mode-map [menu-bar move previous]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
695 '("Previous" . rmail-summary-previous-all))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
696
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
697 (define-key rmail-summary-mode-map [menu-bar move next]
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
698 '("Next" . rmail-summary-next-all))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
699
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
700 (defun rmail-summary-goto-msg (&optional n nowarn skip-rmail)
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
701 (interactive "P")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
702 (if (consp n) (setq n (prefix-numeric-value n)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
703 (if (eobp) (forward-line -1))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
704 (beginning-of-line)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
705 (let ((buf rmail-buffer)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
706 (cur (point))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
707 (curmsg (string-to-int
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
708 (buffer-substring (point)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
709 (min (point-max) (+ 5 (point)))))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
710 (if (not n)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
711 (setq n curmsg)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
712 (if (< n 1)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
713 (progn (message "No preceding message")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
714 (setq n 1)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
715 (if (> n rmail-total-messages)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
716 (progn (message "No following message")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
717 (goto-char (point-max))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
718 (rmail-summary-goto-msg)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
719 (goto-char (point-min))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
720 (if (not (re-search-forward (concat "^ *" (int-to-string n)) nil t))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
721 (progn (or nowarn (message "Message %d not found" n))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
722 (setq n curmsg)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
723 (goto-char cur))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
724 (beginning-of-line)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
725 (skip-chars-forward " ")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
726 (skip-chars-forward "0-9")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
727 (save-excursion (if (= (following-char) ?-)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
728 (let ((buffer-read-only nil))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
729 (delete-char 1)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
730 (insert " "))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
731 (beginning-of-line)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
732 (if skip-rmail
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
733 nil
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
734 (pop-to-buffer buf)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
735 (rmail-show-message n)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
736 (pop-to-buffer rmail-summary-buffer))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
737
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
738 (defun rmail-summary-scroll-msg-up (&optional dist)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
739 "Scroll other window forward."
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
740 (interactive "P")
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
741 (scroll-other-window dist))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
742
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
743 (defun rmail-summary-scroll-msg-down (&optional dist)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
744 "Scroll other window backward."
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
745 (interactive "P")
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
746 (scroll-other-window
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
747 (cond ((eq dist '-) nil)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
748 ((null dist) '-)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
749 (t (- (prefix-numeric-value dist))))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
750
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
751 (defun rmail-summary-beginning-of-message ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
752 "Show current message from the beginning."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
753 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
754 (pop-to-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
755 (beginning-of-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
756 (pop-to-buffer rmail-summary-buffer))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
757
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
758 (defun rmail-summary-quit ()
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
759 "Quit out of Rmail and Rmail summary."
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
760 (interactive)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
761 (rmail-summary-wipe)
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
762 (rmail-quit))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
763
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
764 (defun rmail-summary-wipe ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
765 "Kill and wipe away Rmail summary, remaining within Rmail."
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
766 (interactive)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
767 (save-excursion (set-buffer rmail-buffer) (setq rmail-summary-buffer nil))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
768 (let ((rmail-wind (get-buffer-window rmail-buffer)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
769 (kill-buffer (current-buffer))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
770 ;; Delete window if not only one.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
771 (if (not (eq (selected-window) (next-window nil 'no-minibuf)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
772 (delete-window))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
773 ;; Switch to the rmail buffer in this window.
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
774 ;; Select the window with rmail in it, then delete this window.
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
775 (and rmail-wind (select-window rmail-wind))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
776
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
777 (defun rmail-summary-expunge ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
778 "Actually erase all deleted messages and recompute summary headers."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
779 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
780 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
781 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
782 (rmail-only-expunge))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
783 (rmail-update-summary))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
784
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
785 (defun rmail-summary-expunge-and-save ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
786 "Expunge and save RMAIL file."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
787 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
788 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
789 (set-buffer rmail-buffer)
3466
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
790 (rmail-only-expunge))
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
791 (rmail-update-summary)
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
792 (save-excursion
3461
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
793 (set-buffer rmail-buffer)
3466
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
794 (save-buffer)))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
795
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
796 (defun rmail-summary-get-new-mail ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
797 "Get new mail and recompute summary headers."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
798 (interactive)
3466
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
799 (let (msg)
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
800 (save-excursion
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
801 (set-buffer rmail-buffer)
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
802 (rmail-get-new-mail)
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
803 ;; Get the proper new message number.
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
804 (setq msg rmail-current-message))
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
805 ;; Make sure that message is displayed.
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
806 (rmail-summary-goto-msg msg)))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
807
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
808 (defun rmail-summary-input (filename)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
809 "Run Rmail on file FILENAME."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
810 (interactive "FRun rmail on RMAIL file: ")
3466
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
811 ;; We switch windows here, then display the other Rmail file there.
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
812 (pop-to-buffer rmail-buffer)
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
813 (rmail filename))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
814
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
815 (defun rmail-summary-first-message ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
816 "Show first message in Rmail file from summary buffer."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
817 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
818 (beginning-of-buffer))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
819
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
820 (defun rmail-summary-last-message ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
821 "Show last message in Rmail file from summary buffer."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
822 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
823 (end-of-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
824 (forward-line -1))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
825
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
826 (defvar rmail-summary-edit-map nil)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
827 (if rmail-summary-edit-map
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
828 nil
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
829 (setq rmail-summary-edit-map
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
830 (nconc (make-sparse-keymap) (cdr text-mode-map)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
831 (define-key rmail-summary-edit-map "\C-c\C-c" 'rmail-cease-edit)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
832 (define-key rmail-summary-edit-map "\C-c\C-]" 'rmail-abort-edit))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
833
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
834 (defun rmail-summary-edit-current-message ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
835 "Edit the contents of this message."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
836 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
837 (pop-to-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
838 (rmail-edit-current-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
839 (use-local-map rmail-summary-edit-map))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
840
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
841 (defun rmail-summary-cease-edit ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
842 "Finish editing message, then go back to Rmail summary buffer."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
843 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
844 (rmail-cease-edit)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
845 (pop-to-buffer rmail-summary-buffer))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
846
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
847 (defun rmail-summary-abort-edit ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
848 "Abort edit of current message; restore original contents.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
849 Go back to summary buffer."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
850 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
851 (rmail-abort-edit)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
852 (pop-to-buffer rmail-summary-buffer))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
853
3862
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
854 (defun rmail-summary-search-backward (regexp &optional n)
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
855 "Show message containing next match for REGEXP.
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
856 Prefix argument gives repeat count; negative argument means search
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
857 backwards (through earlier messages).
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
858 Interactively, empty argument means use same regexp used last time."
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
859 (interactive
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
860 (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
861 (prompt
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
862 (concat (if reversep "Reverse " "") "Rmail search (regexp): "))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
863 regexp)
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
864 (if rmail-search-last-regexp
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
865 (setq prompt (concat prompt
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
866 "(default "
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
867 rmail-search-last-regexp
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
868 ") ")))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
869 (setq regexp (read-string prompt))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
870 (cond ((not (equal regexp ""))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
871 (setq rmail-search-last-regexp regexp))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
872 ((not rmail-search-last-regexp)
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
873 (error "No previous Rmail search string")))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
874 (list rmail-search-last-regexp
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
875 (prefix-numeric-value current-prefix-arg))))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
876 ;; Don't use save-excursion because that prevents point from moving
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
877 ;; properly in the summary buffer.
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
878 (let ((buffer (current-buffer)))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
879 (unwind-protect
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
880 (progn
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
881 (set-buffer rmail-buffer)
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
882 (rmail-search regexp (- n)))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
883 (set-buffer buffer))))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
884
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
885 (defun rmail-summary-search (regexp &optional n)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
886 "Show message containing next match for REGEXP.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
887 Prefix argument gives repeat count; negative argument means search
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
888 backwards (through earlier messages).
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
889 Interactively, empty argument means use same regexp used last time."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
890 (interactive
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
891 (let* ((reversep (< (prefix-numeric-value current-prefix-arg) 0))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
892 (prompt
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
893 (concat (if reversep "Reverse " "") "Rmail search (regexp): "))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
894 regexp)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
895 (if rmail-search-last-regexp
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
896 (setq prompt (concat prompt
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
897 "(default "
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
898 rmail-search-last-regexp
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
899 ") ")))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
900 (setq regexp (read-string prompt))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
901 (cond ((not (equal regexp ""))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
902 (setq rmail-search-last-regexp regexp))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
903 ((not rmail-search-last-regexp)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
904 (error "No previous Rmail search string")))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
905 (list rmail-search-last-regexp
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
906 (prefix-numeric-value current-prefix-arg))))
3862
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
907 ;; Don't use save-excursion because that prevents point from moving
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
908 ;; properly in the summary buffer.
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
909 (let ((buffer (current-buffer)))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
910 (unwind-protect
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
911 (progn
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
912 (set-buffer rmail-buffer)
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
913 (rmail-search regexp n))
d65e83bd1120 (rmail-summary-mode-map): Add local menu bar bindings.
Richard M. Stallman <rms@gnu.org>
parents: 3509
diff changeset
914 (set-buffer buffer))))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
915
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
916 (defun rmail-summary-toggle-header ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
917 "Show original message header if pruned header currently shown, or vice versa."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
918 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
919 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
920 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
921 (rmail-toggle-header)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
922
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
923 (defun rmail-summary-add-label (label)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
924 "Add LABEL to labels associated with current Rmail message.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
925 Completion is performed over known labels when reading."
3461
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
926 (interactive (list (save-excursion
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
927 (set-buffer rmail-buffer)
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
928 (rmail-read-label "Add label"))))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
929 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
930 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
931 (rmail-add-label label)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
932
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
933 (defun rmail-summary-kill-label (label)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
934 "Remove LABEL from labels associated with current Rmail message.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
935 Completion is performed over known labels when reading."
3461
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
936 (interactive (list (save-excursion
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
937 (set-buffer rmail-buffer)
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
938 (rmail-read-label "Kill label"))))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
939 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
940 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
941 (rmail-set-label label nil)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
942
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
943 ;;;; *** Rmail Summary Mailing Commands ***
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
944
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
945 (defun rmail-summary-mail ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
946 "Send mail in another window.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
947 While composing the message, use \\[mail-yank-original] to yank the
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
948 original message into it."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
949 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
950 (mail-other-window nil nil nil nil nil rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
951 (use-local-map (copy-keymap (current-local-map)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
952 (define-key (current-local-map)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
953 "\C-c\C-c" 'rmail-summary-send-and-exit))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
954
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
955 (defun rmail-summary-continue ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
956 "Continue composing outgoing message previously being composed."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
957 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
958 (mail-other-window t))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
959
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
960 (defun rmail-summary-reply (just-sender)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
961 "Reply to the current message.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
962 Normally include CC: to all other recipients of original message;
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
963 prefix argument means ignore them.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
964 While composing the reply, use \\[mail-yank-original] to yank the
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
965 original message into it."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
966 (interactive "P")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
967 (let (mailbuf)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
968 (save-window-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
969 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
970 (rmail-reply just-sender)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
971 (setq mailbuf (current-buffer)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
972 (pop-to-buffer mailbuf)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
973 (use-local-map (copy-keymap (current-local-map)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
974 (define-key (current-local-map)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
975 "\C-c\C-c" 'rmail-summary-send-and-exit)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
976
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
977 (defun rmail-summary-retry-failure ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
978 "Edit a mail message which is based on the contents of the current message.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
979 For a message rejected by the mail system, extract the interesting headers and
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
980 the body of the original message; otherwise copy the current message."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
981 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
982 (let (mailbuf)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
983 (save-window-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
984 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
985 (rmail-retry-failure)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
986 (setq mailbuf (current-buffer)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
987 (pop-to-buffer mailbuf)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
988 (use-local-map (copy-keymap (current-local-map)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
989 (define-key (current-local-map)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
990 "\C-c\C-c" 'rmail-summary-send-and-exit)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
991
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
992 (defun rmail-summary-send-and-exit ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
993 "Send mail reply and return to summary buffer."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
994 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
995 (mail-send-and-exit t))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
996
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
997 (defun rmail-summary-forward ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
998 "Forward the current message to another user."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
999 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1000 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1001 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1002 (rmail-forward)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1003 (use-local-map (copy-keymap (current-local-map)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1004 (define-key (current-local-map)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1005 "\C-c\C-c" 'rmail-summary-send-and-exit)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1006
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1007 ;; Summary output commands.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1008
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1009 (defun rmail-summary-output-to-rmail-file ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1010 "Append the current message to an Rmail file named FILE-NAME.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1011 If the file does not exist, ask if it should be created.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1012 If file is being visited, the message is appended to the Emacs
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1013 buffer visiting that file."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1014 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1015 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1016 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1017 (call-interactively 'rmail-output-to-rmail-file)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1018
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1019 (defun rmail-summary-output ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1020 "Append this message to Unix mail file named FILE-NAME."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1021 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1022 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1023 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
1024 (call-interactively 'rmail-output)))
3879
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1025
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1026 ;; Sorting messages in Rmail Summary buffer.
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1027
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1028 (defun rmail-summary-sort-by-date (reverse)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1029 "Sort messages of current Rmail summary by date.
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1030 If prefix argument REVERSE is non-nil, sort them in reverse order."
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1031 (interactive "P")
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1032 (rmail-sort-from-summary (function rmail-sort-by-date) reverse))
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1033
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1034 (defun rmail-summary-sort-by-subject (reverse)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1035 "Sort messages of current Rmail summary by subject.
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1036 If prefix argument REVERSE is non-nil, sort them in reverse order."
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1037 (interactive "P")
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1038 (rmail-sort-from-summary (function rmail-sort-by-subject) reverse))
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1039
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1040 (defun rmail-summary-sort-by-author (reverse)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1041 "Sort messages of current Rmail summary by author.
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1042 If prefix argument REVERSE is non-nil, sort them in reverse order."
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1043 (interactive "P")
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1044 (rmail-sort-from-summary (function rmail-sort-by-author) reverse))
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1045
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1046 (defun rmail-summary-sort-by-recipient (reverse)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1047 "Sort messages of current Rmail summary by recipient.
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1048 If prefix argument REVERSE is non-nil, sort them in reverse order."
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1049 (interactive "P")
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1050 (rmail-sort-from-summary (function rmail-sort-by-recipient) reverse))
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1051
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1052 (defun rmail-summary-sort-by-correspondent (reverse)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1053 "Sort messages of current Rmail summary by other correspondent.
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1054 If prefix argument REVERSE is non-nil, sort them in reverse order."
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1055 (interactive "P")
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1056 (rmail-sort-from-summary (function rmail-sort-by-correspondent) reverse))
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1057
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1058 (defun rmail-summary-sort-by-lines (reverse)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1059 "Sort messages of current Rmail summary by lines of the message.
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1060 If prefix argument REVERSE is non-nil, sort them in reverse order."
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1061 (interactive "P")
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1062 (rmail-sort-from-summary (function rmail-sort-by-lines) reverse))
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1063
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1064 (defun rmail-sort-from-summary (sortfun reverse)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1065 "Sort Rmail messages from Summary buffer and update it after sorting."
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1066 (require 'rmailsort)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1067 (pop-to-buffer rmail-buffer)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1068 (funcall sortfun reverse)
b8c99f30ca3f (rmail-summary-mode-map): Bind summary sort commands.
Richard M. Stallman <rms@gnu.org>
parents: 3862
diff changeset
1069 (rmail-summary))
658
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 130
diff changeset
1070
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 130
diff changeset
1071 ;;; rmailsum.el ends here