annotate shared/mail-extras.el @ 67:a9b2a2335782 default tip

make setting advert whiten as well if needed, handle naked div in replying to html
author Henry S Thompson <ht@inf.ed.ac.uk>
date Sat, 21 Dec 2024 20:00:43 +0000
parents 0a81352bd7d0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
1 ;; Last edited: Fri Nov 2 10:26:24 1990
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
2 ;; extra widgets for rmail and rmailsum
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
3 ;; Copyright (C) 1990 Henry S. Thompson
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
4
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
5 ;; This file is part of GNU Emacs.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
6
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
7 ;; GNU Emacs is distributed in the hope that it will be useful,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
8 ;; but WITHOUT ANY WARRANTY. No author or distributor
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
9 ;; accepts responsibility to anyone for the consequences of using it
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
10 ;; or for whether it serves any particular purpose or works at all,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
11 ;; unless he says so in writing. Refer to the GNU Emacs General Public
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
12 ;; License for full details.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
13
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
14 ;; Everyone is granted permission to copy, modify and redistribute
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
15 ;; GNU Emacs, but only under the conditions described in the
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
16 ;; GNU Emacs General Public License. A copy of this license is
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
17 ;; supposed to have been given to you along with GNU Emacs so you
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
18 ;; can know your rights and responsibilities. It should be in a
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
19 ;; file named COPYING. Among other things, the copyright notice
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
20 ;; and this notice must be preserved on all copies.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
21
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
22 (provide 'mail-extras)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
23 (require 'rmail)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
24 (require 'sendmail)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
25
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
26
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
28 ;; mods and fixes for reading mail ;;
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
30
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
31 (defvar ht-last-file (expand-file-name "~/XMAIL")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
32 "default for moving mail to")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
33 (make-variable-buffer-local 'ht-last-file)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
34
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
35 (defvar rmht-always-recompress t
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
36 "If non-nil, when saving into compressed babyl file,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
37 always recompress and save immediately")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
38
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
39 (defvar rmht-allow-autosave t
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
40 "if non-nil, leaves autosave alone for compressed babyl files,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
41 otherwise turns it off")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
42
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
43 (add-hook 'rmail-mode-hook 'rmail-mode-fun1)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
44 (add-hook 'rmail-mode-hook 'rmail-mode-fun2)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
45
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
46 ;; run the first time in to RMAIL
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
47 (defun rmail-mode-fun1 ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
48 "add ht's mods to RMAIL"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
49 (define-key rmail-mode-map "R" 'reply-w/o-cc)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
50 (define-key rmail-mode-map "M" 'rmht-output)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
51 (define-key rmail-mode-map "H" 'print-buffer)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
52 (define-key rmail-mode-map "W" 'edit-and-move-to-diary)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
53 (define-key rmail-mode-map "D" 'update-default-diary)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
54 (define-key rmail-mode-map "F" 're-post-failed-mail)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
55 (define-key rmail-mode-map "B" 'ht-write-body-to-file)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
56 (define-key rmail-mode-map "E" 'extract-attachment)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
57 ;; fix the doc string
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
58 (repl-comment 'rmail-mode
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
59 "Rmail Mode is used by \\[rmail] for editing Rmail files.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
60 All normal editing commands are turned off.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
61 Instead, these commands are available (additions from ht's mail-extras.el
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
62 indicated by *:
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
63
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
64 . Move point to front of this message (same as \\[beginning-of-buffer]).
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
65 SPC Scroll to next screen of this message.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
66 DEL Scroll to previous screen of this message.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
67 n Move to Next non-deleted message.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
68 p Move to Previous non-deleted message.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
69 M-n Move to Next message whether deleted or not.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
70 M-p Move to Previous message whether deleted or not.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
71 > Move to the last message in Rmail file.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
72 j Jump to message specified by numeric position in file.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
73 M-s Search for string and show message it is found in.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
74 d Delete this message, move to next nondeleted.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
75 C-d Delete this message, move to previous nondeleted.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
76 u Undelete message. Tries current message, then earlier messages
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
77 till a deleted message is found.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
78 e Expunge deleted messages.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
79 s Expunge and save the file.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
80 q Quit Rmail: expunge, save, then switch to another buffer.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
81 C-x C-s Save without expunging.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
82 g Move new mail from system spool directory or mbox into this file.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
83 m Mail a message (same as \\[mail-other-window]).
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
84 c Continue composing outgoing message started before.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
85 r Reply to this message. Like m but initializes some fields.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
86 R * Like r, but reply to originator only.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
87 f Forward this message to another user.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
88 F * like f, but assumes message is \"failed mail\" for re-sending
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
89 o Output this message to an Rmail file (append it).
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
90 C-o Output this message to a Unix-format mail file (append it).
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
91 M * Output this message to a file,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
92 in format determined by extension (babyl for RMAIL/msg for Unix).
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
93 B * Write the body of the message to a file, leaving a pointer
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
94 H * Print the message (same as \\<global-map>\\[print-buffer]).\\<rmail-mode-map>
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
95 i Input Rmail file. Run Rmail on that file.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
96 a Add label to message. It will be displayed in the mode line.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
97 k Kill label. Remove a label from current message.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
98 C-M-n Move to Next message with specified label
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
99 (label defaults to last one specified).
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
100 Standard labels: filed, unseen, answered, forwarded, deleted.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
101 Any other label is present only if you add it with `a'.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
102 C-M-p Move to Previous message with specified label
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
103 h, C-M-h Show headers buffer, with a one line summary of each message.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
104 l, C-M-l Like h only just messages with particular label(s) are summarized.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
105 C-M-r Like h only just messages with particular recipient(s) are summarized.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
106 t Toggle header, show Rmail header if unformatted or vice versa.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
107 w Edit the current message. C-c C-c to return to Rmail.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
108 W * Edit the subject field. C-c C-c to move the message to the Diary.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
109 D * Update the Diary.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
110
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
111 Messages for the diary (see also \\[describe-mode] in rmail-summary mode
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
112 or \\[describe-function] rmail-summary-mode) should have a subject field
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
113 which begins with the date and optional time of the event described therein.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
114 These must be in the form
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
115 d m y t
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
116 where d is one or two digits for the day,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
117 m is either the full month name or the first three letters thereof,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
118 y is two digits for the year,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
119 and t, if present, is 4 digits for the time,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
120 thus for example
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
121 31 Jun 91 1530
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
122 ")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
123 (remove-hook 'rmail-mode-hook 'rmail-mode-fun1))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
124
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
125 (defun rmail-mode-fun2 ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
126 "always run in RMAIL mode"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
127 (setq case-fold-search t))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
128
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
129 (defun reply-w/o-cc ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
130 "Reply as r, but without sending to other recipients"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
131 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
132 (rmail-reply t))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
133
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
134 (defun rmht-output (&optional file-name gnus)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
135 "Move to a file, determining format by extension (babyl/msg)"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
136 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
137 (if (not file-name)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
138 (setq file-name (car (get-move-file-name))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
139 (if (string-match "\\.g?[zZ]$" file-name)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
140 (let ((clean-file-name (substring file-name 0 (match-beginning 0)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
141 there)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
142 (if (setq there (get-file-buffer clean-file-name))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
143 nil
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
144 (save-window-excursion (rmail clean-file-name)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
145 (setq there
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
146 (get-file-buffer clean-file-name))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
147 (rmht-output clean-file-name gnus)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
148 (if rmht-always-recompress
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
149 (save-excursion
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
150 (set-buffer there)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
151 (save-buffer))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
152 (if (not rmht-allow-autosave)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
153 (save-excursion
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
154 (set-buffer there)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
155 (auto-save-mode -1)))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
156 (setq file-name (expand-file-name file-name))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
157 (save-excursion
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
158 (if (string-match "\\.babyl$" file-name)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
159 (if gnus
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
160 (gnus-output-to-rmail file-name)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
161 (rmail-output-to-rmail-file file-name 1))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
162 (if (string-match "\\.msg$" file-name)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
163 (if (or (get-file-buffer file-name)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
164 (file-exists-p file-name)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
165 (yes-or-no-p
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
166 (concat "\"" file-name "\" does not exist, create it? ")))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
167 (rmail-output file-name 1)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
168 (error "Output file does not exist"))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
169 (error "not a valid mail file: %s" file-name))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
170 (setq ht-last-file file-name)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
171 (if (not gnus) (ht-rmail-delete-forward))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
172
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
173 (defun get-move-file-name ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
174 "get a file name for moving a message to"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
175 (list (read-file-name
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
176 (concat "Output message to file: (default "
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
177 (file-name-nondirectory ht-last-file)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
178 ") ")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
179 (file-name-directory ht-last-file)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
180 ht-last-file)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
181
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
182 (defun re-post-failed-mail ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
183 "try to salvage the original from failed mail and prepare to resend it"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
184 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
185 (rmail-forward nil)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
186 (let ((top (point))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
187 subjp textp)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
188 (re-search-forward "^Subject: ")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
189 (kill-line nil)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
190 (setq subjp (point))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
191 (re-search-forward "^From: ") ; the bouncer
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
192 (re-search-forward "^From: ") ; should be us
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
193 (re-search-forward "^Subject: ")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
194 (kill-line nil)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
195 (save-excursion (goto-char subjp)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
196 (yank))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
197 (beginning-of-line 3)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
198 (setq textp (point))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
199 (goto-char top)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
200 (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
201 (beginning-of-line 2)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
202 (delete-region (point) textp)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
203 (goto-char top)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
204
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
205 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
206 ;; mods and fixes for mail summaries ;;
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
207 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
208
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
209 (add-hook 'rmail-summary-mode-hook 'rmail-summary-mode-fun1)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
210
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
211 ;; run the first time we make a summary window
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
212 (defun rmail-summary-mode-fun1 ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
213 "install ht's mods"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
214 (define-key rmail-summary-mode-map "r" 'rms-reply-w-cc)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
215 (define-key rmail-summary-mode-map "R" 'rms-reply-w/o-cc)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
216 (define-key rmail-summary-mode-map "s" 'diary-save)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
217 (define-key rmail-summary-mode-map "m" 'rms-move)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
218 (define-key rmail-summary-mode-map "d" 'rms-delete)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
219 (define-key rmail-summary-mode-map "h" 'rms-hardcopy)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
220 (define-key rmail-summary-mode-map " " 'ht-rmailsum-scroll-msg-up)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
221 (define-key rmail-summary-mode-map "\177" 'ht-rmailsum-scroll-msg-down)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
222 ;; fix the doc string
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
223 (repl-comment 'rmail-summary-mode
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
224 "Major mode in effect in Rmail summary buffer.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
225 A subset of the Rmail mode commands are supported in this mode.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
226 As commands are issued in the summary buffer the corresponding
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
227 mail message is displayed in the rmail buffer.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
228 Modifications from ht's mail-extras.el indicated with *:
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
229
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
230 n Move to next undeleted message, or arg messages.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
231 p Move to previous undeleted message, or arg messages.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
232 C-n Move to next, or forward arg messages.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
233 C-p Move to previous, or previous arg messages.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
234 j Jump to the message at the cursor location.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
235 d Delete the message at the cursor location and move to next message.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
236 u Undelete this or previous deleted message.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
237 q Quit Rmail.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
238 x Exit and kill the summary window.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
239 space * If cursor is on line of current message,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
240 scroll message window forward. Otherwise, jump to indicated message.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
241 delete * same as space, but scrolls backward.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
242 r * Same as r in rmail window. Reply to current message.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
243 R * Same as R in rmail window. Reply to current message, originator only.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
244 s * Update and save the rmail file, and re-summarise. Re-sorts if Diary.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
245 m * Same as M in rmail window. Moves message to file.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
246 h * Same as H in rmail window. Prints message on line printer.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
247
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
248 Entering this mode calls value of hook variable rmail-summary-mode-hook.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
249
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
250 If the file summarised is called by the name given in ht-diary-file-name,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
251 which defaults to diary.babyl,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
252 then the summary will be called *Diary*, sorted in date order and
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
253 formated in a special way.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
254
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
255 Messages in the diary should have a subject field
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
256 which begins with the date and optional time of the event described therein.
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
257 These must be in the form
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
258 d m y t
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
259 where d is one or two digits for the day,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
260 m is either the full month name or the first three letters thereof,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
261 y is two digits for the year,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
262 and t, if present, is 4 digits for the time,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
263 thus for example
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
264 Subject: 31 Jun 91 1530 Hades freezing ceremony followed by champagne reception
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
265 ")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
266 (remove-hook 'rmail-summary-mode-hook 'rmail-summary-mode-fun1))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
267
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
268 (defun rmht-sum-reply (sender-only)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
269 "reply to current message"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
270 (rmail-summary-goto-msg)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
271 (pop-to-buffer rmail-buffer)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
272 (rmail-reply sender-only)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
273 (switch-to-buffer rmail-summary-buffer)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
274 (switch-to-buffer "*mail*")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
275 )
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
276
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
277 (defun rms-reply-w-cc ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
278 "Do r in RMAIL - reply to everybody"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
279 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
280 (rmht-sum-reply nil))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
281
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
282 (defun rms-reply-w/o-cc ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
283 "Do R in RMAIL - reply to sender only"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
284 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
285 (rmht-sum-reply t))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
286
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
287 (defun rms-save ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
288 "expunge deleted messages, save RMAIL file and re-display headers"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
289 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
290 (pop-to-buffer rmail-buffer)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
291 (rmail-expunge-and-save)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
292 (rmail-summary))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
293
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
294 (defun rms-delete ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
295 "delete current and move down to next in summary buffer"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
296 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
297 (rmail-summary-goto-msg)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
298 (save-excursion
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
299 (rmail-summary-delete-forward nil))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
300 (rms-del))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
301
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
302 (defun rms-move ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
303 "Move to a file, mode determined by file extension (babyl/msg)"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
304 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
305 (rmail-summary-goto-msg)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
306 (save-excursion
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
307 (set-buffer rmail-buffer)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
308 (rmht-output))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
309 (rms-del))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
310
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
311 (defun rms-del ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
312 "mark current summary line as deleted and move down"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
313 (let ((buffer-read-only nil))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
314 (skip-chars-forward " ")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
315 (skip-chars-forward "[0-9]")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
316 (delete-char 1)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
317 (insert "D"))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
318 (forward-line 1))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
319
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
320 (defun rms-hardcopy ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
321 "hardcopy the current message"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
322 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
323 (pop-to-buffer rmail-buffer)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
324 (print-buffer)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
325 (pop-to-buffer rmail-summary-buffer))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
326
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
327
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
328 ;; fix interpretation of SPACE and DEL in summary windows to
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
329 ;; 1) scroll the right window regardless of how many panes are up;
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
330 ;; 2) go to the message associated with the current line if not already there,
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
331 ;; a la gnus, for instance
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
332
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
333 (defun ht-rmailsum-normalise ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
334 "if not already showing message named on current line, go to it & return t"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
335 (beginning-of-line)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
336 (let ((current-msg-num (cdr (assoc 'rmail-current-message
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
337 (buffer-local-variables
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
338 (or rmail-buffer
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
339 (error
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
340 "not in a summary buffer"))))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
341 (line-message-num (string-to-int
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
342 (buffer-substring
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
343 (point)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
344 (min (point-max)(+ 5 (point)))))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
345 (if (= current-msg-num line-message-num)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
346 nil
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
347 (rmail-summary-goto-msg line-message-num)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
348 t)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
349
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
350 (defun ht-rmailsum-scroll-msg-up (&optional dist)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
351 "goto other message or scroll current message forward"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
352 (interactive "P")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
353 (if (ht-rmailsum-normalise)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
354 nil
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
355 (pop-to-buffer rmail-buffer)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
356 (scroll-up dist)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
357 (pop-to-buffer rmail-summary-buffer)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
358
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
359 (defun ht-rmailsum-scroll-msg-down (&optional dist)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
360 "goto other message or scroll current message backward"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
361 (interactive "P")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
362 (if (ht-rmailsum-normalise)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
363 nil
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
364 (pop-to-buffer rmail-buffer)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
365 (scroll-down dist)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
366 (pop-to-buffer rmail-summary-buffer)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
367
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
368 (autoload 'edit-and-move-to-diary "diary")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
369 (autoload 'update-diary "diary")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
370 (autoload 'diary-save "diary")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
371
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
372 ;; unfortunately, gnus mucks about with the buffers before calling
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
373 ;; mail, so we have to intervene to make the about-to-mail-hook work right
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
374
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
375 (defun ht-Subject-mode-fun ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
376 "fix the map to save window state"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
377 ; (define-key gnus-summary-mode-map "r" 'ht-Subject-mail-reply)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
378 ; (define-key gnus-summary-mode-map "R" 'ht-Subject-mail-reply-with-original)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
379 ; (define-key gnus-summary-mode-map "m" 'ht-Subject-mail-other-window)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
380 (define-key gnus-summary-save-map "M" 'ht-Subject-move)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
381 (remove-hook 'gnus-summary-mode-hook 'ht-Subject-mode-fun))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
382
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
383 (add-hook 'gnus-summary-mode-hook 'ht-Subject-mode-fun)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
384
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
385 (defun ht-Subject-mail-reply (yank)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
386 "Runs about-to-mail-hook, then calls gnus-summary-mail-reply"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
387 (interactive "P")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
388 (require 'sendmail)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
389 (run-hooks 'about-to-mail-hook)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
390 (let (about-to-mail-hook)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
391 (gnus-summary-reply yank)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
392
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
393 (defun ht-Subject-mail-reply-with-original ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
394 "Runs about-to-mail-hook, then calls gnus-summary-mail-reply-with-original"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
395 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
396 (require 'sendmail)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
397 (run-hooks 'about-to-mail-hook)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
398 (let (about-to-mail-hook)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
399 (gnus-summary-reply-with-original)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
400
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
401 (defun ht-Subject-mail-other-window ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
402 "Runs about-to-mail-hook, then calls gnus-summary-mail-other-window"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
403 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
404 (require 'sendmail)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
405 (run-hooks 'about-to-mail-hook)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
406 (let (about-to-mail-hook)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
407 (gnus-summary-mail-other-window)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
408
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
409 (defun ht-Subject-move ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
410 "Move article to a file, mode determined by file extension (babyl/msg)"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
411 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
412 (gnus-summary-select-article)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
413 (save-excursion
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
414 (set-buffer gnus-article-buffer)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
415 (rmht-output nil t)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
416
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
417
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
418 (defun ht-write-body-to-file (file)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
419 "Write the body of the message to a file and replace it with a pointer"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
420 (interactive "FFile to save in: ")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
421 (goto-char (point-min))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
422 (or (search-forward "\n\n" nil t)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
423 (error "Can't find text"))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
424 (write-region (point)(point-max) file)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
425 (rmail-edit-current-message)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
426 (delete-region (point)(point-max))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
427 (insert "\n>> " file "\n")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
428 (rmail-cease-edit)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
429 (rmht-output))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
430
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
431 (defun extract-attachment ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
432 "extract attachments from a multi-part mime message"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
433 (interactive)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
434 (rmail-toggle-header)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
435 (mime/viewer-mode)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
436 (let ((pt 0))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
437 (while (progn
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
438 (mime-viewer/next-content)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
439 (and
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
440 (equal "*Preview-RMAIL*" (buffer-name (current-buffer)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
441 (not (= pt (point)))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
442 (setq pt (point))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
443 (if (looking-at "^\\[[0-9]* [^ ]+ <")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
444 (mime-viewer/extract-content))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
445 (if (not (equal "*Preview-RMAIL*" (buffer-name (current-buffer))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
446 ;; we fell off the end
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
447 (rmail-previous-undeleted-message 1))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
448 (kill-buffer "*Preview-RMAIL*")
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
449 )
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
450
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
451 ;; see message-citation-line-function in message.el
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
452 (defun safe-citation ()
3
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
453 (use-text-not-html)
0
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
454 (when message-reply-headers
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
455 (let ((from (mail-header-from message-reply-headers)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
456 (cond ((string-match "^\"?\\([^\"]*\\)\"? <.*>$" from)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
457 (insert (match-string 1 from) " writes:\n\n"))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
458 ((string-match "^\\([^<@]*\\)@" from)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
459 (insert (match-string 1 from) " writes:\n\n"))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
460 (t
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
461 (insert "[anon] writes:\n\n"))))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
462
3
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
463 (defun use-text-not-html (&optional clear)
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
464 (when (and (if clear (looking-at "<html")
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
465 (looking-at "> <html"))
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
466 (bufferp (get-buffer "*Shell Command Output*")))
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
467 ;; replace HTML only with result of my HTML filter
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
468 (delete-region (point)(mark t))
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
469 (insert-buffer "*Shell Command Output*")
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
470 (when (looking-at "piping")
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
471 (kill-entire-line)
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
472 (indent-rigidly (point) (mark t) -3)
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
473 (if (not clear)
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
474 (submerge-region (point) (mark t)))))
0a81352bd7d0 catch up
Henry S. Thompson <ht@inf.ed.ac.uk>
parents: 0
diff changeset
475 )
0
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
476
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
477 (setq message-citation-line-function (function safe-citation))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
478
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
479 ;(load-library "mailcrypt") ; provides "mc-setversion"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
480 ;(mc-setversion "gpg") ; for PGP 2.6 (default); also "5.0" and "gpg"
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
481 ;(autoload 'mc-install-write-mode "mailcrypt" nil t)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
482 ;(autoload 'mc-install-read-mode "mailcrypt" nil t)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
483 ;(add-hook 'mail-mode-hook 'mc-install-write-mode)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
484 ;(add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
485 ;(add-hook 'message-mode-hook 'mc-install-write-mode)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
486 ;(add-hook 'news-reply-mode-hook 'mc-install-write-mode)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
487 ;(setq mc-passwd-timeout 6000)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
488 ;;; Key server at Cambridge University (Cambridge, England)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
489 ;(setq mc-pgp-fetch-methods '(mc-pgp-fetch-from-keyrings
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
490 ; mc-pgp-fetch-from-http))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
491 ;(require 'pgg)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
492 ;(add-hook 'message-send-hook 'my-sign-message)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
493 (setq hack-yn-map (copy-keymap query-replace-map))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
494 (define-key hack-yn-map 'return 'act)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
495
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
496 (defun my-sign-message ()
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
497 (goto-char (point-min))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
498 (unless
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
499 (or
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
500 (re-search-forward "<#\\(part\\|mml\\) " nil t)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
501 ; signing attachments doesn't seem
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
502 ; to work well
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
503 (search-forward "\n-- \nHenry S. Thompson, Central Edinburgh LM" nil t)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
504 ; Don't sign Quaker mail
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
505 )
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
506 (let* ((headers (mail-header-extract-no-properties))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
507 (cc (mail-header 'cc))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
508 (to (mail-header 'to)))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
509 (if (and to
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
510 (not (string-match "htcalendar[@]markup\.co\.uk" to))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
511 (not (string-match "^ht$" to))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
512 (or
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
513 (string-match "w3.org" to)
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
514 (and cc (string-match "w3.org" cc))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
515 (let ((query-replace-map hack-yn-map))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
516 (y-or-n-p "Sign message? "))))
107d592c5f4a DICE versions, used by pers/common, recursive, I think/hope
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
517 (mml-secure-message-sign-pgp)))))