annotate lisp/mail/rmailsum.el @ 3466:c8f52c44d9a4

(rmail-summary-expunge-and-save): Do save-buffer last. Use two separate save-excursion calls. (rmail-summary-input): Use pop-to-buffer. (rmail-summary-get-new-mail): Gobble rmail-current-message; later go to that message. (rmail-summary-next-msg): Start at end of line, if moving forward. Move to beginning of line, after the loop. (rmail-new-summary): Fix format of elt in minor-mode-alist.
author Richard M. Stallman <rms@gnu.org>
date Fri, 04 Jun 1993 02:24:45 +0000
parents 1dec1449324d
children a1ef317ceb18
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
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
370 (or (funcall search "^.....[^D]" nil t)
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)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
589 )
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
590
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
591 (defun rmail-summary-goto-msg (&optional n nowarn skip-rmail)
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
592 (interactive "P")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
593 (if (consp n) (setq n (prefix-numeric-value n)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
594 (if (eobp) (forward-line -1))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
595 (beginning-of-line)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
596 (let ((buf rmail-buffer)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
597 (cur (point))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
598 (curmsg (string-to-int
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
599 (buffer-substring (point)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
600 (min (point-max) (+ 5 (point)))))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
601 (if (not n)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
602 (setq n curmsg)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
603 (if (< n 1)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
604 (progn (message "No preceding message")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
605 (setq n 1)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
606 (if (> n rmail-total-messages)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
607 (progn (message "No following message")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
608 (goto-char (point-max))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
609 (rmail-summary-goto-msg)))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
610 (goto-char (point-min))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
611 (if (not (re-search-forward (concat "^ *" (int-to-string n)) nil t))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
612 (progn (or nowarn (message "Message %d not found" n))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
613 (setq n curmsg)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
614 (goto-char cur))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
615 (beginning-of-line)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
616 (skip-chars-forward " ")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
617 (skip-chars-forward "0-9")
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
618 (save-excursion (if (= (following-char) ?-)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
619 (let ((buffer-read-only nil))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
620 (delete-char 1)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
621 (insert " "))))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
622 (beginning-of-line)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
623 (if skip-rmail
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
624 nil
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
625 (pop-to-buffer buf)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
626 (rmail-show-message n)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
627 (pop-to-buffer rmail-summary-buffer))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
628
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
629 (defun rmail-summary-scroll-msg-up (&optional dist)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
630 "Scroll other window forward."
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
631 (interactive "P")
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
632 (scroll-other-window dist))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
633
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
634 (defun rmail-summary-scroll-msg-down (&optional dist)
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
635 "Scroll other window backward."
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
636 (interactive "P")
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
637 (scroll-other-window
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
638 (cond ((eq dist '-) nil)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
639 ((null dist) '-)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
640 (t (- (prefix-numeric-value dist))))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
641
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
642 (defun rmail-summary-beginning-of-message ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
643 "Show current message from the beginning."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
644 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
645 (pop-to-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
646 (beginning-of-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
647 (pop-to-buffer rmail-summary-buffer))
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
648
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
649 (defun rmail-summary-quit ()
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
650 "Quit out of Rmail and Rmail summary."
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
651 (interactive)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
652 (rmail-summary-wipe)
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
653 (rmail-quit))
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
654
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
655 (defun rmail-summary-wipe ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
656 "Kill and wipe away Rmail summary, remaining within Rmail."
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
657 (interactive)
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
658 (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
659 (let ((rmail-wind (get-buffer-window rmail-buffer)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
660 (kill-buffer (current-buffer))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
661 ;; Delete window if not only one.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
662 (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
663 (delete-window))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
664 ;; Switch to the rmail buffer in this window.
130
ad8219ab7a97 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
665 ;; 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
666 (and rmail-wind (select-window rmail-wind))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
667
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
668 (defun rmail-summary-expunge ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
669 "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
670 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
671 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
672 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
673 (rmail-only-expunge))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
674 (rmail-update-summary))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
675
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
676 (defun rmail-summary-expunge-and-save ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
677 "Expunge and save RMAIL file."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
678 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
679 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
680 (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
681 (rmail-only-expunge))
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
682 (rmail-update-summary)
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
683 (save-excursion
3461
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
684 (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
685 (save-buffer)))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
686
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
687 (defun rmail-summary-get-new-mail ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
688 "Get new mail and recompute summary headers."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
689 (interactive)
3466
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
690 (let (msg)
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
691 (save-excursion
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
692 (set-buffer rmail-buffer)
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
693 (rmail-get-new-mail)
c8f52c44d9a4 (rmail-summary-expunge-and-save): Do save-buffer last.
Richard M. Stallman <rms@gnu.org>
parents: 3461
diff changeset
694 ;; 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
695 (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
696 ;; 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
697 (rmail-summary-goto-msg msg)))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
698
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
699 (defun rmail-summary-input (filename)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
700 "Run Rmail on file FILENAME."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
701 (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
702 ;; 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
703 (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
704 (rmail filename))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
705
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
706 (defun rmail-summary-first-message ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
707 "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
708 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
709 (beginning-of-buffer))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
710
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
711 (defun rmail-summary-last-message ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
712 "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
713 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
714 (end-of-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
715 (forward-line -1))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
716
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
717 (defvar rmail-summary-edit-map nil)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
718 (if rmail-summary-edit-map
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
719 nil
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
720 (setq rmail-summary-edit-map
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
721 (nconc (make-sparse-keymap) (cdr text-mode-map)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
722 (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
723 (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
724
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
725 (defun rmail-summary-edit-current-message ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
726 "Edit the contents of this message."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
727 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
728 (pop-to-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
729 (rmail-edit-current-message)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
730 (use-local-map rmail-summary-edit-map))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
731
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
732 (defun rmail-summary-cease-edit ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
733 "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
734 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
735 (rmail-cease-edit)
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
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
738 (defun rmail-summary-abort-edit ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
739 "Abort edit of current message; restore original contents.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
740 Go back to summary buffer."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
741 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
742 (rmail-abort-edit)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
743 (pop-to-buffer rmail-summary-buffer))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
744
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
745 (defun rmail-summary-search (regexp &optional n)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
746 "Show message containing next match for REGEXP.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
747 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
748 backwards (through earlier messages).
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
749 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
750 (interactive
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
751 (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
752 (prompt
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
753 (concat (if reversep "Reverse " "") "Rmail search (regexp): "))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
754 regexp)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
755 (if rmail-search-last-regexp
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
756 (setq prompt (concat prompt
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
757 "(default "
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
758 rmail-search-last-regexp
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
759 ") ")))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
760 (setq regexp (read-string prompt))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
761 (cond ((not (equal regexp ""))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
762 (setq rmail-search-last-regexp regexp))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
763 ((not rmail-search-last-regexp)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
764 (error "No previous Rmail search string")))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
765 (list rmail-search-last-regexp
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
766 (prefix-numeric-value current-prefix-arg))))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
767 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
768 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
769 (rmail-search regexp n)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
770
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
771 (defun rmail-summary-toggle-header ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
772 "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
773 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
774 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
775 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
776 (rmail-toggle-header)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
777
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
778 (defun rmail-summary-add-label (label)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
779 "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
780 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
781 (interactive (list (save-excursion
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
782 (set-buffer rmail-buffer)
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
783 (rmail-read-label "Add label"))))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
784 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
785 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
786 (rmail-add-label label)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
787
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
788 (defun rmail-summary-kill-label (label)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
789 "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
790 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
791 (interactive (list (save-excursion
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
792 (set-buffer rmail-buffer)
1dec1449324d (rmail-summary-expunge-and-save):
Richard M. Stallman <rms@gnu.org>
parents: 3443
diff changeset
793 (rmail-read-label "Kill label"))))
2077
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
794 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
795 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
796 (rmail-set-label label nil)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
797
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
798 ;;;; *** Rmail Summary Mailing Commands ***
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
799
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
800 (defun rmail-summary-mail ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
801 "Send mail in another window.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
802 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
803 original message into it."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
804 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
805 (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
806 (use-local-map (copy-keymap (current-local-map)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
807 (define-key (current-local-map)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
808 "\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
809
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
810 (defun rmail-summary-continue ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
811 "Continue composing outgoing message previously being composed."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
812 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
813 (mail-other-window t))
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-reply (just-sender)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
816 "Reply to the current message.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
817 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
818 prefix argument means ignore them.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
819 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
820 original message into it."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
821 (interactive "P")
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
822 (let (mailbuf)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
823 (save-window-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
824 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
825 (rmail-reply just-sender)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
826 (setq mailbuf (current-buffer)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
827 (pop-to-buffer mailbuf)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
828 (use-local-map (copy-keymap (current-local-map)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
829 (define-key (current-local-map)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
830 "\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
831
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
832 (defun rmail-summary-retry-failure ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
833 "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
834 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
835 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
836 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
837 (let (mailbuf)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
838 (save-window-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
839 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
840 (rmail-retry-failure)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
841 (setq mailbuf (current-buffer)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
842 (pop-to-buffer mailbuf)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
843 (use-local-map (copy-keymap (current-local-map)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
844 (define-key (current-local-map)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
845 "\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
846
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
847 (defun rmail-summary-send-and-exit ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
848 "Send mail reply and return to summary buffer."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
849 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
850 (mail-send-and-exit t))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
851
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
852 (defun rmail-summary-forward ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
853 "Forward the current message to another user."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
854 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
855 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
856 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
857 (rmail-forward)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
858 (use-local-map (copy-keymap (current-local-map)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
859 (define-key (current-local-map)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
860 "\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
861
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
862 ;; Summary output commands.
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
863
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
864 (defun rmail-summary-output-to-rmail-file ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
865 "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
866 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
867 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
868 buffer visiting that file."
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
869 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
870 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
871 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
872 (call-interactively 'rmail-output-to-rmail-file)))
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
873
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
874 (defun rmail-summary-output ()
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
875 "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
876 (interactive)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
877 (save-excursion
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
878 (set-buffer rmail-buffer)
6885836c2f98 (rmail-update-summary): New function.
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
879 (call-interactively 'rmail-output)))
658
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 130
diff changeset
880
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 130
diff changeset
881 ;;; rmailsum.el ends here