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