Mercurial > emacs
annotate lisp/mh-e/mh-letter.el @ 68473:e238dd02cdad
(mh-letter-menu): Remove. Defvar no longer needed to shush compiler.
(mh-letter-mode): Remove Mail menu.
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Mon, 30 Jan 2006 00:49:56 +0000 |
parents | 4bd450a8dbe2 |
children | 0f44616074ba |
rev | line source |
---|---|
68465 | 1 ;;; mh-letter.el --- MH-Letter mode |
2 | |
3 ;; Copyright (C) 1993, 1995, 1997, | |
4 ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. | |
5 | |
6 ;; Author: Bill Wohler <wohler@newt.com> | |
7 ;; Maintainer: Bill Wohler <wohler@newt.com> | |
8 ;; Keywords: mail | |
9 ;; See: mh-e.el | |
10 | |
11 ;; This file is part of GNU Emacs. | |
12 | |
13 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
14 ;; it under the terms of the GNU General Public License as published by | |
15 ;; the Free Software Foundation; either version 2, or (at your option) | |
16 ;; any later version. | |
17 | |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; You should have received a copy of the GNU General Public License | |
24 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
25 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
26 ;; Boston, MA 02110-1301, USA. | |
27 | |
28 ;;; Commentary: | |
29 | |
30 ;; Mode for composing and sending a draft message. | |
31 | |
32 ;; Functions that would ordinarily be in here that are needed by | |
33 ;; mh-show.el should be placed in the Message Utilities section in | |
34 ;; mh-utils.el. That will help prevent the loading of this file until | |
35 ;; a message is actually composed. | |
36 | |
37 ;;; Change Log: | |
38 | |
39 ;;; Code: | |
40 | |
41 (require 'mh-e) | |
42 | |
43 (require 'gnus-util) | |
44 | |
45 ;; Dynamically-created function not found in mh-loaddefs.el. | |
46 (autoload 'mh-tool-bar-letter-buttons-init "mh-tool-bar") | |
47 | |
48 (autoload 'mml-insert-tag "mml") | |
49 | |
50 ;;; Variables | |
51 | |
52 (defvar mh-letter-complete-function-alist | |
53 '((bcc . mh-alias-letter-expand-alias) | |
54 (cc . mh-alias-letter-expand-alias) | |
55 (dcc . mh-alias-letter-expand-alias) | |
56 (fcc . mh-folder-expand-at-point) | |
57 (from . mh-alias-letter-expand-alias) | |
58 (mail-followup-to . mh-alias-letter-expand-alias) | |
59 (mail-reply-to . mh-alias-letter-expand-alias) | |
60 (reply-to . mh-alias-letter-expand-alias) | |
61 (to . mh-alias-letter-expand-alias)) | |
62 "Alist of header fields and completion functions to use.") | |
63 | |
64 (defvar mh-hidden-header-keymap | |
65 (let ((map (make-sparse-keymap))) | |
66 (mh-do-in-gnu-emacs | |
67 (define-key map [mouse-2] 'mh-letter-toggle-header-field-display-button)) | |
68 (mh-do-in-xemacs | |
69 (define-key map '(button2) | |
70 'mh-letter-toggle-header-field-display-button)) | |
71 map)) | |
72 | |
73 (defvar mh-yank-hooks nil | |
74 "Obsolete hook for modifying a citation just inserted in the mail buffer. | |
75 | |
76 Each hook function can find the citation between point and mark. | |
77 And each hook function should leave point and mark around the | |
78 citation text as modified. | |
79 | |
80 This is a normal hook, misnamed for historical reasons. It is | |
81 semi-obsolete and is only used if `mail-citation-hook' is nil.") | |
82 | |
83 | |
84 | |
85 ;;; Letter Menu | |
86 | |
87 (easy-menu-define | |
88 mh-letter-menu mh-letter-mode-map "Menu for MH-E letter mode." | |
89 '("Letter" | |
90 ["Send This Draft" mh-send-letter t] | |
91 ["Split Current Line" mh-open-line t] | |
92 ["Check Recipient" mh-check-whom t] | |
93 ["Yank Current Message" mh-yank-cur-msg t] | |
94 ["Insert a Message..." mh-insert-letter t] | |
95 ["Insert Signature" mh-insert-signature t] | |
96 ("Encrypt/Sign Message" | |
97 ["Sign Message" | |
98 mh-mml-secure-message-sign mh-pgp-support-flag] | |
99 ["Encrypt Message" | |
100 mh-mml-secure-message-encrypt mh-pgp-support-flag] | |
101 ["Sign+Encrypt Message" | |
102 mh-mml-secure-message-signencrypt mh-pgp-support-flag] | |
103 ["Disable Security" | |
104 mh-mml-unsecure-message mh-pgp-support-flag] | |
105 "--" | |
106 "Security Method" | |
107 ["PGP (MIME)" (setq mh-mml-method-default "pgpmime") | |
108 :style radio | |
109 :selected (equal mh-mml-method-default "pgpmime")] | |
110 ["PGP" (setq mh-mml-method-default "pgp") | |
111 :style radio | |
112 :selected (equal mh-mml-method-default "pgp")] | |
113 ["S/MIME" (setq mh-mml-method-default "smime") | |
114 :style radio | |
115 :selected (equal mh-mml-method-default "smime")] | |
116 "--" | |
117 ["Save Method as Default" | |
118 (customize-save-variable 'mh-mml-method-default mh-mml-method-default) t] | |
119 ) | |
120 ["Compose Insertion..." mh-compose-insertion t] | |
121 ["Compose Compressed tar (MH)..." | |
122 mh-mh-compose-external-compressed-tar t] | |
123 ["Compose Get File (MH)..." mh-mh-compose-anon-ftp t] | |
124 ["Compose Forward..." mh-compose-forward t] | |
125 ;; The next two will have to be merged. But I also need to make sure the | |
126 ;; user can't mix tags of both types. | |
127 ["Pull in All Compositions (MH)" | |
128 mh-mh-to-mime (mh-mh-directive-present-p)] | |
129 ["Pull in All Compositions (MML)" | |
130 mh-mml-to-mime (mh-mml-tag-present-p)] | |
131 ["Revert to Non-MIME Edit (MH)" | |
132 mh-mh-to-mime-undo (equal mh-compose-insertion 'mh)] | |
133 ["Kill This Draft" mh-fully-kill-draft t])) | |
134 | |
135 | |
136 | |
137 ;;; MH-Letter Keys | |
138 | |
139 ;; If this changes, modify mh-letter-mode-help-messages accordingly, above. | |
140 (gnus-define-keys mh-letter-mode-map | |
141 " " mh-letter-complete-or-space | |
142 "," mh-letter-confirm-address | |
143 "\C-c?" mh-help | |
144 "\C-c\C-\\" mh-fully-kill-draft ;if no C-q | |
145 "\C-c\C-^" mh-insert-signature ;if no C-s | |
146 "\C-c\C-c" mh-send-letter | |
147 "\C-c\C-d" mh-insert-identity | |
148 "\C-c\C-e" mh-mh-to-mime | |
149 "\C-c\C-f\C-a" mh-to-field | |
150 "\C-c\C-f\C-b" mh-to-field | |
151 "\C-c\C-f\C-c" mh-to-field | |
152 "\C-c\C-f\C-d" mh-to-field | |
153 "\C-c\C-f\C-f" mh-to-fcc | |
154 "\C-c\C-f\C-l" mh-to-field | |
155 "\C-c\C-f\C-m" mh-to-field | |
156 "\C-c\C-f\C-r" mh-to-field | |
157 "\C-c\C-f\C-s" mh-to-field | |
158 "\C-c\C-f\C-t" mh-to-field | |
159 "\C-c\C-fa" mh-to-field | |
160 "\C-c\C-fb" mh-to-field | |
161 "\C-c\C-fc" mh-to-field | |
162 "\C-c\C-fd" mh-to-field | |
163 "\C-c\C-ff" mh-to-fcc | |
164 "\C-c\C-fl" mh-to-field | |
165 "\C-c\C-fm" mh-to-field | |
166 "\C-c\C-fr" mh-to-field | |
167 "\C-c\C-fs" mh-to-field | |
168 "\C-c\C-ft" mh-to-field | |
169 "\C-c\C-i" mh-insert-letter | |
170 "\C-c\C-m\C-e" mh-mml-secure-message-encrypt | |
171 "\C-c\C-m\C-f" mh-compose-forward | |
172 "\C-c\C-m\C-g" mh-mh-compose-anon-ftp | |
173 "\C-c\C-m\C-i" mh-compose-insertion | |
174 "\C-c\C-m\C-m" mh-mml-to-mime | |
175 "\C-c\C-m\C-n" mh-mml-unsecure-message | |
176 "\C-c\C-m\C-s" mh-mml-secure-message-sign | |
177 "\C-c\C-m\C-t" mh-mh-compose-external-compressed-tar | |
178 "\C-c\C-m\C-u" mh-mh-to-mime-undo | |
179 "\C-c\C-m\C-x" mh-mh-compose-external-type | |
180 "\C-c\C-mee" mh-mml-secure-message-encrypt | |
181 "\C-c\C-mes" mh-mml-secure-message-signencrypt | |
182 "\C-c\C-mf" mh-compose-forward | |
183 "\C-c\C-mg" mh-mh-compose-anon-ftp | |
184 "\C-c\C-mi" mh-compose-insertion | |
185 "\C-c\C-mm" mh-mml-to-mime | |
186 "\C-c\C-mn" mh-mml-unsecure-message | |
187 "\C-c\C-mse" mh-mml-secure-message-signencrypt | |
188 "\C-c\C-mss" mh-mml-secure-message-sign | |
189 "\C-c\C-mt" mh-mh-compose-external-compressed-tar | |
190 "\C-c\C-mu" mh-mh-to-mime-undo | |
191 "\C-c\C-mx" mh-mh-compose-external-type | |
192 "\C-c\C-o" mh-open-line | |
193 "\C-c\C-q" mh-fully-kill-draft | |
194 "\C-c\C-s" mh-insert-signature | |
195 "\C-c\C-t" mh-letter-toggle-header-field-display | |
196 "\C-c\C-w" mh-check-whom | |
197 "\C-c\C-y" mh-yank-cur-msg | |
198 "\C-c\M-d" mh-insert-auto-fields | |
199 "\M-\t" mh-letter-complete | |
200 "\t" mh-letter-next-header-field-or-indent | |
201 [backtab] mh-letter-previous-header-field) | |
202 | |
203 ;; "C-c /" prefix is used in mh-letter-mode by pgp.el and mailcrypt.el. | |
204 | |
205 | |
206 | |
207 ;;; MH-Letter Help Messages | |
208 | |
209 ;; Group messages logically, more or less. | |
210 (defvar mh-letter-mode-help-messages | |
211 '((nil | |
212 "Send letter: \\[mh-send-letter] " | |
213 "Open line: \\[mh-open-line]\n" | |
214 "Kill letter: \\[mh-fully-kill-draft] " | |
215 "Check recipients: \\[mh-check-whom]\n\n" | |
216 "Insert:\n" | |
217 " Current message: \\[mh-yank-cur-msg]\n" | |
218 " Attachment: \\[mh-compose-insertion]\n" | |
219 " Message to forward: \\[mh-compose-forward]\n" | |
220 " Signature: \\[mh-insert-signature]\n\n" | |
221 "Security:\n" | |
222 " Encrypt message: \\[mh-mml-secure-message-encrypt]\n" | |
223 " Sign message: \\[mh-mml-secure-message-sign]\n" | |
224 " Sign+Encrypt message: \\[mh-mml-secure-message-signencrypt]")) | |
225 "Key binding cheat sheet. | |
226 | |
227 This is an associative array which is used to show the most | |
228 common commands. The key is a prefix char. The value is one or | |
229 more strings which are concatenated together and displayed in the | |
230 minibuffer if ? is pressed after the prefix character. The | |
231 special key nil is used to display the non-prefixed commands. | |
232 | |
233 The substitutions described in `substitute-command-keys' are | |
234 performed as well.") | |
235 | |
236 | |
237 | |
238 ;;; MH-Letter Font Lock | |
239 | |
240 (defvar mh-letter-font-lock-keywords | |
241 `(,@(mh-show-font-lock-keywords-with-cite) | |
242 (mh-font-lock-field-data | |
243 (1 'mh-letter-header-field prepend t))) | |
244 "Additional expressions to highlight in MH-Letter buffers.") | |
245 | |
246 (defun mh-font-lock-field-data (limit) | |
247 "Find header field region between point and LIMIT." | |
248 (and (< (point) (mh-letter-header-end)) | |
249 (< (point) limit) | |
250 (let ((end (min limit (mh-letter-header-end))) | |
251 (point (point)) | |
252 data-end data-begin field) | |
253 (end-of-line) | |
254 (setq data-end (if (re-search-forward "^[^ \t]" end t) | |
255 (match-beginning 0) | |
256 end)) | |
257 (goto-char (1- data-end)) | |
258 (if (not (re-search-backward "\\(^[^ \t][^:]*\\):[ \t]*" nil t)) | |
259 (setq data-begin (point-min)) | |
260 (setq data-begin (match-end 0)) | |
261 (setq field (match-string 1))) | |
262 (setq data-begin (max point data-begin)) | |
263 (goto-char (if (equal point data-end) (1+ data-end) data-end)) | |
264 (cond ((and field (mh-letter-skipped-header-field-p field)) | |
265 (set-match-data nil) | |
266 nil) | |
267 (t (set-match-data | |
268 (list data-begin data-end data-begin data-end)) | |
269 t))))) | |
270 | |
271 (defun mh-letter-header-end () | |
272 "Find the end of the message header. | |
273 This function is to be used only for font locking. It works by | |
274 searching for `mh-mail-header-separator' in the buffer." | |
275 (save-excursion | |
276 (goto-char (point-min)) | |
277 (cond ((equal mh-mail-header-separator "") (point-min)) | |
278 ((search-forward (format "\n%s\n" mh-mail-header-separator) nil t) | |
279 (line-beginning-position 0)) | |
280 (t (point-min))))) | |
281 | |
282 | |
283 | |
284 ;;; MH-Letter Mode | |
285 | |
286 (defvar mh-letter-buttons-init-flag nil) | |
287 | |
288 ;; Shush compiler. | |
289 (eval-when-compile (mh-do-in-xemacs (defvar font-lock-defaults))) | |
290 | |
291 ;; Ensure new buffers won't get this mode if default-major-mode is nil. | |
292 (put 'mh-letter-mode 'mode-class 'special) | |
293 | |
294 ;;;###mh-autoload | |
295 (define-derived-mode mh-letter-mode mail-mode "MH-Letter" | |
296 "Mode for composing letters in MH-E\\<mh-letter-mode-map>. | |
297 | |
298 When you have finished composing, type \\[mh-send-letter] to send | |
299 the message using the MH mail handling system. | |
300 | |
301 There are two types of tags used by MH-E when composing MIME | |
302 messages: MML and MH. The option `mh-compose-insertion' controls | |
303 what type of tags are inserted by MH-E commands. These tags can | |
304 be converted to MIME body parts by running \\[mh-mh-to-mime] for | |
305 MH-style directives or \\[mh-mml-to-mime] for MML tags. | |
306 | |
307 Options that control this mode can be changed with | |
308 \\[customize-group]; specify the \"mh-compose\" group. | |
309 | |
310 When a message is composed, the hooks `text-mode-hook', | |
311 `mail-mode-hook', and `mh-letter-mode-hook' are run (in that | |
312 order). | |
313 | |
314 \\{mh-letter-mode-map}" | |
315 (mh-find-path) | |
316 (make-local-variable 'mh-send-args) | |
317 (make-local-variable 'mh-annotate-char) | |
318 (make-local-variable 'mh-annotate-field) | |
319 (make-local-variable 'mh-previous-window-config) | |
320 (make-local-variable 'mh-sent-from-folder) | |
321 (make-local-variable 'mh-sent-from-msg) | |
322 (mh-do-in-gnu-emacs | |
323 (unless mh-letter-buttons-init-flag | |
324 (mh-tool-bar-letter-buttons-init) | |
325 (setq mh-letter-buttons-init-flag t))) | |
326 ;; Set the local value of mh-mail-header-separator according to what is | |
327 ;; present in the buffer... | |
328 (set (make-local-variable 'mh-mail-header-separator) | |
329 (save-excursion | |
330 (goto-char (mh-mail-header-end)) | |
331 (buffer-substring-no-properties (point) (line-end-position)))) | |
332 (make-local-variable 'mail-header-separator) | |
333 (setq mail-header-separator mh-mail-header-separator) ;override sendmail.el | |
334 (mh-set-help mh-letter-mode-help-messages) | |
335 (setq buffer-invisibility-spec '((vanish . t) t)) | |
336 (set (make-local-variable 'line-move-ignore-invisible) t) | |
337 | |
338 ;; Enable undo since a show-mode buffer might have been reused. | |
339 (buffer-enable-undo) | |
340 (set (make-local-variable 'tool-bar-map) mh-letter-tool-bar-map) | |
341 (mh-funcall-if-exists mh-tool-bar-init :letter) | |
342 (make-local-variable 'font-lock-defaults) | |
343 (cond | |
344 ((or (equal mh-highlight-citation-style 'font-lock) | |
345 (equal mh-highlight-citation-style 'gnus)) | |
346 ;; Let's use font-lock even if gnus is used in show-mode. The reason | |
347 ;; is that gnus uses static text properties which are not appropriate | |
348 ;; for a buffer that will be edited. So the choice here is either fontify | |
349 ;; the citations and header... | |
350 (setq font-lock-defaults '(mh-letter-font-lock-keywords t))) | |
351 (t | |
352 ;; ...or the header only | |
353 (setq font-lock-defaults '((mh-show-font-lock-keywords) t)))) | |
354 (easy-menu-add mh-letter-menu) | |
68473
e238dd02cdad
(mh-letter-menu): Remove. Defvar no longer needed to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
68470
diff
changeset
|
355 ;; Maybe we want to use the existing Mail menu from mail-mode in |
e238dd02cdad
(mh-letter-menu): Remove. Defvar no longer needed to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
68470
diff
changeset
|
356 ;; 9.0; in the mean time, let's remove it since the redundancy will |
e238dd02cdad
(mh-letter-menu): Remove. Defvar no longer needed to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
68470
diff
changeset
|
357 ;; only produce confusion. |
e238dd02cdad
(mh-letter-menu): Remove. Defvar no longer needed to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
68470
diff
changeset
|
358 (define-key mh-letter-mode-map [menu-bar mail] 'undefined) |
e238dd02cdad
(mh-letter-menu): Remove. Defvar no longer needed to shush compiler.
Bill Wohler <wohler@newt.com>
parents:
68470
diff
changeset
|
359 (mh-do-in-xemacs (easy-menu-remove mail-menubar-menu)) |
68465 | 360 (setq fill-column mh-letter-fill-column) |
361 ;; If text-mode-hook turned on auto-fill, tune it for messages | |
362 (when auto-fill-function | |
363 (make-local-variable 'auto-fill-function) | |
364 (setq auto-fill-function 'mh-auto-fill-for-letter))) | |
365 | |
366 | |
367 | |
368 ;;; MH-Letter Commands | |
369 | |
370 ;; Alphabetical. | |
371 ;; See also mh-comp.el and mh-mime.el. | |
372 | |
373 (defun mh-check-whom () | |
374 "Verify recipients, showing expansion of any aliases. | |
375 | |
376 This command expands aliases so you can check the actual address(es) | |
377 in the alias. A new buffer named \"*MH-E Recipients*\" is created with | |
378 the output of \"whom\"." | |
379 (interactive) | |
380 (let ((file-name buffer-file-name)) | |
381 (save-buffer) | |
382 (message "Checking recipients...") | |
383 (mh-in-show-buffer (mh-recipients-buffer) | |
384 (bury-buffer (current-buffer)) | |
385 (erase-buffer) | |
386 (mh-exec-cmd-output "whom" t file-name)) | |
387 (message "Checking recipients...done"))) | |
388 | |
389 (defun mh-insert-letter (folder message verbatim) | |
390 "Insert a message. | |
391 | |
392 This command prompts you for the FOLDER and MESSAGE number, which | |
393 defaults to the current message in that folder. It then inserts | |
394 the message, indented by `mh-ins-buf-prefix' (\"> \") unless | |
395 `mh-yank-behavior' is set to one of the supercite flavors in | |
396 which case supercite is used to format the message. Certain | |
397 undesirable header fields (see | |
398 `mh-invisible-header-fields-compiled') are removed before | |
399 insertion. | |
400 | |
401 If given a prefix argument VERBATIM, the header is left intact, the | |
402 message is not indented, and \"> \" is not inserted before each line. | |
403 This command leaves the mark before the letter and point after it." | |
404 (interactive | |
405 (let* ((folder | |
406 (mh-prompt-for-folder "Message from" | |
407 mh-sent-from-folder nil)) | |
408 (default | |
409 (if (and (equal folder mh-sent-from-folder) | |
410 (numberp mh-sent-from-msg)) | |
411 mh-sent-from-msg | |
412 (nth 0 (mh-translate-range folder "cur")))) | |
413 (message | |
414 (read-string (concat "Message number" | |
415 (or (and default | |
416 (format " (default %d): " default)) | |
417 ": "))))) | |
418 (list folder message current-prefix-arg))) | |
419 (save-restriction | |
420 (narrow-to-region (point) (point)) | |
421 (let ((start (point-min))) | |
422 (if (and (equal message "") (numberp mh-sent-from-msg)) | |
423 (setq message (int-to-string mh-sent-from-msg))) | |
424 (insert-file-contents | |
425 (expand-file-name message (mh-expand-file-name folder))) | |
426 (when (not verbatim) | |
427 (mh-clean-msg-header start mh-invisible-header-fields-compiled nil) | |
428 (goto-char (point-max)) ;Needed for sc-cite-original | |
429 (push-mark) ;Needed for sc-cite-original | |
430 (goto-char (point-min)) ;Needed for sc-cite-original | |
431 (mh-insert-prefix-string mh-ins-buf-prefix))))) | |
432 | |
433 ;;;###mh-autoload | |
434 (defun mh-insert-signature (&optional file) | |
435 "Insert signature in message. | |
436 | |
437 This command inserts your signature at the current cursor location. | |
438 | |
439 By default, the text of your signature is taken from the file | |
440 \"~/.signature\". You can read from other sources by changing the | |
441 option `mh-signature-file-name'. | |
442 | |
443 A signature separator (\"-- \") will be added if the signature block | |
444 does not contain one and `mh-signature-separator-flag' is on. | |
445 | |
446 The hook `mh-insert-signature-hook' is run after the signature is | |
447 inserted. Hook functions may access the actual name of the file or the | |
448 function used to insert the signature with `mh-signature-file-name'. | |
449 | |
450 The signature can also be inserted using Identities (see | |
451 `mh-identity-list'). | |
452 | |
453 In a program, you can pass in a signature FILE." | |
454 (interactive) | |
455 (save-excursion | |
456 (insert "\n") | |
457 (let ((mh-signature-file-name (or file mh-signature-file-name)) | |
458 (mh-mh-p (mh-mh-directive-present-p)) | |
459 (mh-mml-p (mh-mml-tag-present-p))) | |
460 (save-restriction | |
461 (narrow-to-region (point) (point)) | |
462 (cond | |
463 ((mh-file-is-vcard-p mh-signature-file-name) | |
464 (if (equal mh-compose-insertion 'mml) | |
465 (insert "<#part type=\"text/x-vcard\" filename=\"" | |
466 mh-signature-file-name | |
467 "\" disposition=inline description=VCard>\n<#/part>") | |
468 (insert "#text/x-vcard; name=\"" | |
469 (file-name-nondirectory mh-signature-file-name) | |
470 "\" [VCard] " (expand-file-name mh-signature-file-name)))) | |
471 (t | |
472 (cond | |
473 (mh-mh-p | |
474 (insert "#\n" "Content-Description: Signature\n")) | |
475 (mh-mml-p | |
476 (mml-insert-tag 'part 'type "text/plain" 'disposition "inline" | |
477 'description "Signature"))) | |
478 (cond ((null mh-signature-file-name)) | |
479 ((and (stringp mh-signature-file-name) | |
480 (file-readable-p mh-signature-file-name)) | |
481 (insert-file-contents mh-signature-file-name)) | |
482 ((functionp mh-signature-file-name) | |
483 (funcall mh-signature-file-name))))) | |
484 (save-restriction | |
485 (widen) | |
486 (run-hooks 'mh-insert-signature-hook)) | |
487 (goto-char (point-min)) | |
488 (when (and (not (mh-file-is-vcard-p mh-signature-file-name)) | |
489 mh-signature-separator-flag | |
490 (> (point-max) (point-min)) | |
491 (not (mh-signature-separator-p))) | |
492 (cond (mh-mh-p | |
493 (forward-line 2)) | |
494 (mh-mml-p | |
495 (forward-line 1))) | |
496 (insert mh-signature-separator)) | |
497 (if (not (> (point-max) (point-min))) | |
498 (message "No signature found"))))) | |
499 (force-mode-line-update)) | |
500 | |
501 (defun mh-letter-complete (arg) | |
502 "Perform completion on header field or word preceding point. | |
503 | |
504 If the field contains addresses (for example, \"To:\" or \"Cc:\") | |
505 or folders (for example, \"Fcc:\") then this command will provide | |
506 alias completion. In the body of the message, this command runs | |
507 `mh-letter-complete-function' instead, which is set to | |
508 `ispell-complete-word' by default. This command takes a prefix | |
509 argument ARG that is passed to the | |
510 `mh-letter-complete-function'." | |
511 (interactive "P") | |
512 (let ((func nil)) | |
513 (cond ((not (mh-in-header-p)) | |
514 (funcall mh-letter-complete-function arg)) | |
515 ((setq func (cdr (assoc (mh-letter-header-field-at-point) | |
516 mh-letter-complete-function-alist))) | |
517 (funcall func)) | |
518 (t (funcall mh-letter-complete-function arg))))) | |
519 | |
520 (defun mh-letter-complete-or-space (arg) | |
521 "Perform completion or insert space. | |
522 | |
523 Turn on the option `mh-compose-space-does-completion-flag' to use | |
524 this command to perform completion in the header. Otherwise, a | |
525 space is inserted; use a prefix argument ARG to specify more than | |
526 one space." | |
527 (interactive "p") | |
528 (let ((func nil) | |
529 (end-of-prev (save-excursion | |
530 (goto-char (mh-beginning-of-word)) | |
531 (mh-beginning-of-word -1)))) | |
532 (cond ((not mh-compose-space-does-completion-flag) | |
533 (self-insert-command arg)) | |
534 ((not (mh-in-header-p)) (self-insert-command arg)) | |
535 ((> (point) end-of-prev) (self-insert-command arg)) | |
536 ((setq func (cdr (assoc (mh-letter-header-field-at-point) | |
537 mh-letter-complete-function-alist))) | |
538 (funcall func)) | |
539 (t (self-insert-command arg))))) | |
540 | |
541 (defun mh-letter-confirm-address () | |
542 "Flash alias expansion. | |
543 | |
544 Addresses are separated by a comma\; when you press the comma, | |
545 this command flashes the alias expansion in the minibuffer if | |
546 `mh-alias-flash-on-comma' is turned on." | |
547 (interactive) | |
548 (cond ((not (mh-in-header-p)) (self-insert-command 1)) | |
549 ((eq (cdr (assoc (mh-letter-header-field-at-point) | |
550 mh-letter-complete-function-alist)) | |
551 'mh-alias-letter-expand-alias) | |
552 (mh-alias-reload-maybe) | |
553 (mh-alias-minibuffer-confirm-address)) | |
554 (t (self-insert-command 1)))) | |
555 | |
556 (defun mh-letter-next-header-field-or-indent (arg) | |
557 "Cycle to next field. | |
558 | |
559 Within the header of the message, this command moves between | |
560 fields that are highlighted with the face | |
561 `mh-letter-header-field', skipping those fields listed in | |
562 `mh-compose-skipped-header-fields'. After the last field, this | |
563 command then moves point to the message body before cycling back | |
564 to the first field. If point is already past the first line of | |
565 the message body, then this command indents by calling | |
566 `indent-relative' with the given prefix argument ARG." | |
567 (interactive "P") | |
568 (let ((header-end (save-excursion | |
569 (goto-char (mh-mail-header-end)) | |
570 (forward-line) | |
571 (point)))) | |
572 (if (> (point) header-end) | |
573 (indent-relative arg) | |
574 (mh-letter-next-header-field)))) | |
575 | |
576 (defun mh-letter-previous-header-field () | |
577 "Cycle to the previous header field. | |
578 | |
579 This command moves backwards between the fields and cycles to the | |
580 body of the message after the first field. Unlike the command | |
581 \\[mh-letter-next-header-field-or-indent], it will always take | |
582 point to the last field from anywhere in the body." | |
583 (interactive) | |
584 (let ((header-end (mh-mail-header-end))) | |
585 (if (>= (point) header-end) | |
586 (goto-char header-end) | |
587 (mh-header-field-beginning)) | |
588 (cond ((re-search-backward mh-letter-header-field-regexp nil t) | |
589 (if (mh-letter-skipped-header-field-p (match-string 1)) | |
590 (mh-letter-previous-header-field) | |
591 (goto-char (match-end 0)) | |
592 (mh-letter-skip-leading-whitespace-in-header-field))) | |
593 (t (goto-char header-end) | |
594 (forward-line))))) | |
595 | |
596 ;;;###mh-autoload | |
597 (defun mh-letter-toggle-header-field-display (arg) | |
598 "Toggle display of header field at point. | |
599 | |
600 Use this command to display truncated header fields. This command | |
601 is a toggle so entering it again will hide the field. This | |
602 command takes a prefix argument ARG: if negative then the field | |
603 is hidden, if positive then the field is displayed." | |
604 (interactive (list nil)) | |
605 (when (and (mh-in-header-p) | |
606 (progn | |
607 (end-of-line) | |
608 (re-search-backward mh-letter-header-field-regexp nil t))) | |
609 (let ((buffer-read-only nil) | |
610 (modified-flag (buffer-modified-p)) | |
611 (begin (point)) | |
612 end) | |
613 (end-of-line) | |
614 (setq end (1- (if (re-search-forward "^[^ \t]" nil t) | |
615 (match-beginning 0) | |
616 (point-max)))) | |
617 (goto-char begin) | |
618 ;; Make it clickable... | |
619 (add-text-properties begin end `(keymap ,mh-hidden-header-keymap | |
620 mouse-face highlight)) | |
621 (unwind-protect | |
622 (cond ((or (and (not arg) | |
623 (text-property-any begin end 'invisible 'vanish)) | |
624 (and (numberp arg) (>= arg 0)) | |
625 (and (eq arg 'long) (> (line-beginning-position 5) end))) | |
626 (remove-text-properties begin end '(invisible nil)) | |
627 (search-forward ":" (line-end-position) t) | |
628 (mh-letter-skip-leading-whitespace-in-header-field)) | |
629 ;; XXX Redesign to make usable by user. Perhaps use a positive | |
630 ;; numeric prefix to make that many lines visible. | |
631 ((eq arg 'long) | |
632 (end-of-line 4) | |
633 (mh-letter-truncate-header-field end) | |
634 (beginning-of-line)) | |
635 (t (end-of-line) | |
636 (mh-letter-truncate-header-field end) | |
637 (beginning-of-line))) | |
638 (set-buffer-modified-p modified-flag))))) | |
639 | |
640 (defun mh-open-line () | |
641 "Insert a newline and leave point before it. | |
642 | |
643 This command is similar to the command \\[open-line] in that it | |
644 inserts a newline after point. It differs in that it also inserts | |
645 the right number of quoting characters and spaces so that the | |
646 next line begins in the same column as it was. This is useful | |
647 when breaking up paragraphs in replies." | |
648 (interactive) | |
649 (let ((column (current-column)) | |
650 (prefix (mh-current-fill-prefix))) | |
651 (if (> (length prefix) column) | |
652 (message "Sorry, point seems to be within the line prefix") | |
653 (newline 2) | |
654 (insert prefix) | |
655 (while (> column (current-column)) | |
656 (insert " ")) | |
657 (forward-line -1)))) | |
658 | |
659 (defun mh-to-fcc (&optional folder) | |
660 "Move to \"Fcc:\" header field. | |
661 | |
662 This command will prompt you for the FOLDER name in which to file | |
663 a copy of the draft." | |
664 (interactive (list (mh-prompt-for-folder | |
665 "Fcc" | |
666 (or (and mh-default-folder-for-message-function | |
667 (save-excursion | |
668 (goto-char (point-min)) | |
669 (funcall | |
670 mh-default-folder-for-message-function))) | |
671 "") | |
672 t))) | |
673 (let ((last-input-char ?\C-f)) | |
674 (expand-abbrev) | |
675 (save-excursion | |
676 (mh-to-field) | |
677 (insert (if (mh-folder-name-p folder) | |
678 (substring folder 1) | |
679 folder))))) | |
680 | |
681 (defvar mh-to-field-choices '(("a" . "Mail-Reply-To:") | |
682 ("b" . "Bcc:") | |
683 ("c" . "Cc:") | |
684 ("d" . "Dcc:") | |
685 ("f" . "Fcc:") | |
686 ("l" . "Mail-Followup-To:") | |
687 ("m" . "From:") | |
688 ("r" . "Reply-To:") | |
689 ("s" . "Subject:") | |
690 ("t" . "To:")) | |
691 "Alist of (final-character . field-name) choices for `mh-to-field'.") | |
692 | |
693 (defun mh-to-field () | |
694 "Move to specified header field. | |
695 | |
696 The field is indicated by the previous keystroke (the last | |
697 keystroke of the command) according to the list in the variable | |
698 `mh-to-field-choices'. | |
699 Create the field if it does not exist. | |
700 Set the mark to point before moving." | |
701 (interactive) | |
702 (expand-abbrev) | |
703 (let ((target (cdr (or (assoc (char-to-string (logior last-input-char ?`)) | |
704 mh-to-field-choices) | |
705 ;; also look for a char for version 4 compat | |
706 (assoc (logior last-input-char ?`) | |
707 mh-to-field-choices)))) | |
708 (case-fold-search t)) | |
709 (push-mark) | |
710 (cond ((mh-position-on-field target) | |
711 (let ((eol (point))) | |
712 (skip-chars-backward " \t") | |
713 (delete-region (point) eol)) | |
714 (if (and (not (eq (logior last-input-char ?`) ?s)) | |
715 (save-excursion | |
716 (backward-char 1) | |
717 (not (looking-at "[:,]")))) | |
718 (insert ", ") | |
719 (insert " "))) | |
720 (t | |
721 (if (mh-position-on-field "To:") | |
722 (forward-line 1)) | |
723 (insert (format "%s \n" target)) | |
724 (backward-char 1))))) | |
725 | |
726 ;;;###mh-autoload | |
727 (defun mh-yank-cur-msg () | |
728 "Insert the current message into the draft buffer. | |
729 | |
730 It is often useful to insert a snippet of text from a letter that | |
731 someone mailed to provide some context for your reply. This | |
732 command does this by adding an attribution, yanking a portion of | |
733 text from the message to which you're replying, and inserting | |
734 `mh-ins-buf-prefix' (`> ') before each line. | |
735 | |
736 The attribution consists of the sender's name and email address | |
737 followed by the content of the option | |
738 `mh-extract-from-attribution-verb'. | |
739 | |
740 You can also turn on the option | |
741 `mh-delete-yanked-msg-window-flag' to delete the window | |
742 containing the original message after yanking it to make more | |
743 room on your screen for your reply. | |
744 | |
745 You can control how the message to which you are replying is | |
746 yanked into your reply using `mh-yank-behavior'. | |
747 | |
748 If this isn't enough, you can gain full control over the | |
749 appearance of the included text by setting `mail-citation-hook' | |
750 to a function that modifies it. For example, if you set this hook | |
751 to `trivial-cite' (which is NOT part of Emacs), set | |
752 `mh-yank-behavior' to \"Body and Header\" (see URL | |
753 `http://shasta.cs.uiuc.edu/~lrclause/tc.html'). | |
754 | |
755 Note that if `mail-citation-hook' is set, `mh-ins-buf-prefix' is | |
756 not inserted. If the option `mh-yank-behavior' is set to one of | |
757 the supercite flavors, the hook `mail-citation-hook' is ignored | |
758 and `mh-ins-buf-prefix' is not inserted." | |
759 (interactive) | |
760 (if (and mh-sent-from-folder | |
761 (save-excursion (set-buffer mh-sent-from-folder) mh-show-buffer) | |
762 (save-excursion (set-buffer mh-sent-from-folder) | |
763 (get-buffer mh-show-buffer)) | |
764 mh-sent-from-msg) | |
765 (let ((to-point (point)) | |
766 (to-buffer (current-buffer))) | |
767 (set-buffer mh-sent-from-folder) | |
768 (if mh-delete-yanked-msg-window-flag | |
769 (delete-windows-on mh-show-buffer)) | |
770 (set-buffer mh-show-buffer) ; Find displayed message | |
771 (let* ((from-attr (mh-extract-from-attribution)) | |
772 (yank-region (mh-mark-active-p nil)) | |
773 (mh-ins-str | |
774 (cond ((and yank-region | |
775 (or (eq 'supercite mh-yank-behavior) | |
776 (eq 'autosupercite mh-yank-behavior) | |
777 (eq t mh-yank-behavior))) | |
778 ;; supercite needs the full header | |
779 (concat | |
780 (buffer-substring (point-min) (mh-mail-header-end)) | |
781 "\n" | |
782 (buffer-substring (region-beginning) (region-end)))) | |
783 (yank-region | |
784 (buffer-substring (region-beginning) (region-end))) | |
785 ((or (eq 'body mh-yank-behavior) | |
786 (eq 'attribution mh-yank-behavior) | |
787 (eq 'autoattrib mh-yank-behavior)) | |
788 (buffer-substring | |
789 (save-excursion | |
790 (goto-char (point-min)) | |
791 (mh-goto-header-end 1) | |
792 (point)) | |
793 (point-max))) | |
794 ((or (eq 'supercite mh-yank-behavior) | |
795 (eq 'autosupercite mh-yank-behavior) | |
796 (eq t mh-yank-behavior)) | |
797 (buffer-substring (point-min) (point-max))) | |
798 (t | |
799 (buffer-substring (point) (point-max)))))) | |
800 (set-buffer to-buffer) | |
801 (save-restriction | |
802 (narrow-to-region to-point to-point) | |
803 (insert (mh-filter-out-non-text mh-ins-str)) | |
804 (goto-char (point-max)) ;Needed for sc-cite-original | |
805 (push-mark) ;Needed for sc-cite-original | |
806 (goto-char (point-min)) ;Needed for sc-cite-original | |
807 (mh-insert-prefix-string mh-ins-buf-prefix) | |
808 (when (or (eq 'attribution mh-yank-behavior) | |
809 (eq 'autoattrib mh-yank-behavior)) | |
810 (insert from-attr) | |
811 (mh-identity-insert-attribution-verb nil) | |
812 (insert "\n\n")) | |
813 ;; If the user has selected a region, he has already "edited" the | |
814 ;; text, so leave the cursor at the end of the yanked text. In | |
815 ;; either case, leave a mark at the opposite end of the included | |
816 ;; text to make it easy to jump or delete to the other end of the | |
817 ;; text. | |
818 (push-mark) | |
819 (goto-char (point-max)) | |
820 (if (null yank-region) | |
821 (mh-exchange-point-and-mark-preserving-active-mark))))) | |
822 (error "There is no current message"))) | |
823 | |
824 | |
825 | |
826 ;;; Support Routines | |
827 | |
828 (defun mh-auto-fill-for-letter () | |
829 "Perform auto-fill for message. | |
830 Header is treated specially by inserting a tab before continuation | |
831 lines." | |
832 (if (mh-in-header-p) | |
833 (let ((fill-prefix "\t")) | |
834 (do-auto-fill)) | |
835 (do-auto-fill))) | |
836 | |
837 (defun mh-filter-out-non-text (string) | |
838 "Return STRING but without adornments such as MIME buttons and smileys." | |
839 (with-temp-buffer | |
840 ;; Insert the string to filter | |
841 (insert string) | |
842 (goto-char (point-min)) | |
843 | |
844 ;; Remove the MIME buttons | |
845 (let ((can-move-forward t) | |
846 (in-button nil)) | |
847 (while can-move-forward | |
848 (cond ((and (not (get-text-property (point) 'mh-data)) | |
849 in-button) | |
850 (delete-region (1- (point)) (point)) | |
851 (setq in-button nil)) | |
852 ((get-text-property (point) 'mh-data) | |
853 (delete-region (point) | |
854 (save-excursion (forward-line) (point))) | |
855 (setq in-button t)) | |
856 (t (setq can-move-forward (= (forward-line) 0)))))) | |
857 | |
858 ;; Return the contents without properties... This gets rid of emphasis | |
859 ;; and smileys | |
860 (buffer-substring-no-properties (point-min) (point-max)))) | |
861 | |
862 (defun mh-current-fill-prefix () | |
863 "Return the `fill-prefix' on the current line as a string." | |
864 (save-excursion | |
865 (beginning-of-line) | |
866 ;; This assumes that the major-mode sets up adaptive-fill-regexp | |
867 ;; correctly such as mh-letter-mode or sendmail.el's mail-mode. But | |
868 ;; perhaps I should use the variable and simply inserts its value here, | |
869 ;; and set it locally in a let scope. --psg | |
870 (if (re-search-forward adaptive-fill-regexp nil t) | |
871 (match-string 0) | |
872 ""))) | |
873 | |
874 ;;;###mh-autoload | |
875 (defun mh-letter-next-header-field () | |
876 "Cycle to the next header field. | |
877 If we are at the last header field go to the start of the message | |
878 body." | |
879 (let ((header-end (mh-mail-header-end))) | |
880 (cond ((>= (point) header-end) (goto-char (point-min))) | |
881 ((< (point) (progn | |
882 (beginning-of-line) | |
883 (re-search-forward mh-letter-header-field-regexp | |
884 (line-end-position) t) | |
885 (point))) | |
886 (beginning-of-line)) | |
887 (t (end-of-line))) | |
888 (cond ((re-search-forward mh-letter-header-field-regexp header-end t) | |
889 (if (mh-letter-skipped-header-field-p (match-string 1)) | |
890 (mh-letter-next-header-field) | |
891 (mh-letter-skip-leading-whitespace-in-header-field))) | |
892 (t (goto-char header-end) | |
893 (forward-line))))) | |
894 | |
895 ;;;###mh-autoload | |
896 (defun mh-letter-skipped-header-field-p (field) | |
897 "Check if FIELD is to be skipped." | |
898 (let ((field (downcase field))) | |
899 (loop for x in mh-compose-skipped-header-fields | |
900 when (equal (downcase x) field) return t | |
901 finally return nil))) | |
902 | |
903 (defun mh-letter-skip-leading-whitespace-in-header-field () | |
904 "Skip leading whitespace in a header field. | |
905 If the header field doesn't have at least one space after the | |
906 colon then a space character is added." | |
907 (let ((need-space t)) | |
908 (while (memq (char-after) '(?\t ?\ )) | |
909 (forward-char) | |
910 (setq need-space nil)) | |
911 (when need-space (insert " ")))) | |
912 | |
913 ;;;###mh-autoload | |
914 (defun mh-position-on-field (field &optional ignored) | |
915 "Move to the end of the FIELD in the header. | |
916 Move to end of entire header if FIELD not found. | |
917 Returns non-nil iff FIELD was found. | |
918 The optional second arg is for pre-version 4 compatibility and is | |
919 IGNORED." | |
920 (cond ((mh-goto-header-field field) | |
921 (mh-header-field-end) | |
922 t) | |
923 ((mh-goto-header-end 0) | |
924 nil))) | |
925 | |
926 (defun mh-letter-header-field-at-point () | |
927 "Return the header field name at point. | |
928 A symbol is returned whose name is the string obtained by | |
929 downcasing the field name." | |
930 (save-excursion | |
931 (end-of-line) | |
932 (and (re-search-backward mh-letter-header-field-regexp nil t) | |
933 (intern (downcase (match-string 1)))))) | |
934 | |
935 (defun mh-folder-expand-at-point () | |
936 "Do folder name completion in Fcc header field." | |
937 (let* ((end (point)) | |
938 (beg (mh-beginning-of-word)) | |
939 (folder (buffer-substring beg end)) | |
940 (leading-plus (and (> (length folder) 0) (equal (aref folder 0) ?+))) | |
941 (last-slash (mh-search-from-end ?/ folder)) | |
942 (prefix (and last-slash (substring folder 0 last-slash))) | |
943 (choices (mapcar #'(lambda (x) | |
944 (list (cond (prefix (format "%s/%s" prefix x)) | |
945 (leading-plus (format "+%s" x)) | |
946 (t x)))) | |
947 (mh-folder-completion-function folder nil t)))) | |
948 (mh-complete-word folder choices beg end))) | |
949 | |
950 ;;;###mh-autoload | |
951 (defun mh-complete-word (word choices begin end) | |
952 "Complete WORD at from CHOICES. | |
953 Any match found replaces the text from BEGIN to END." | |
954 (let ((completion (try-completion word choices)) | |
955 (completions-buffer "*Completions*")) | |
956 (cond ((eq completion t) | |
957 (ignore-errors | |
958 (kill-buffer completions-buffer)) | |
959 (message "Completed: %s" word)) | |
960 ((null completion) | |
961 (ignore-errors | |
962 (kill-buffer completions-buffer)) | |
963 (message "No completion for %s" word)) | |
964 ((stringp completion) | |
965 (if (equal word completion) | |
966 (with-output-to-temp-buffer completions-buffer | |
967 (mh-display-completion-list (all-completions word choices) | |
968 choices)) | |
969 (ignore-errors | |
970 (kill-buffer completions-buffer)) | |
971 (delete-region begin end) | |
972 (insert completion)))))) | |
973 | |
974 (defun mh-file-is-vcard-p (file) | |
975 "Return t if FILE is a .vcf vcard." | |
976 (let ((case-fold-search t)) | |
977 (and (stringp file) | |
978 (file-exists-p file) | |
979 (or (and (not (mh-have-file-command)) | |
980 (not (null (string-match "\.vcf$" file)))) | |
981 (string-equal "text/x-vcard" (mh-file-mime-type file)))))) | |
982 | |
983 (defun mh-letter-toggle-header-field-display-button (event) | |
984 "Toggle header field display at location of EVENT. | |
985 This function does the same thing as | |
986 `mh-letter-toggle-header-field-display' except that it is | |
987 callable from a mouse button." | |
988 (interactive "e") | |
989 (mh-do-at-event-location event | |
990 (mh-letter-toggle-header-field-display nil))) | |
991 | |
992 (defun mh-letter-truncate-header-field (end) | |
993 "Replace text from current line till END with an ellipsis. | |
994 If the current line is too long truncate a part of it as well." | |
995 (let ((max-len (min (window-width) 62))) | |
996 (when (> (+ (current-column) 4) max-len) | |
997 (backward-char (- (+ (current-column) 5) max-len))) | |
998 (when (> end (point)) | |
999 (add-text-properties (point) end '(invisible vanish))))) | |
1000 | |
1001 (defun mh-extract-from-attribution () | |
1002 "Extract phrase or comment from From header field." | |
1003 (save-excursion | |
1004 (if (not (mh-goto-header-field "From: ")) | |
1005 nil | |
1006 (skip-chars-forward " ") | |
1007 (cond | |
1008 ((looking-at "\"\\([^\"\n]+\\)\" \\(<.+>\\)") | |
1009 (format "%s %s " (match-string 1)(match-string 2))) | |
1010 ((looking-at "\\([^<\n]+<.+>\\)$") | |
1011 (format "%s " (match-string 1))) | |
1012 ((looking-at "\\([^ ]+@[^ ]+\\) +(\\(.+\\))$") | |
1013 (format "%s <%s> " (match-string 2)(match-string 1))) | |
1014 ((looking-at " *\\(.+\\)$") | |
1015 (format "%s " (match-string 1))))))) | |
1016 | |
1017 (defun mh-insert-prefix-string (mh-ins-string) | |
1018 "Insert prefix string before each line in buffer. | |
1019 The inserted letter is cited using `sc-cite-original' if | |
1020 `mh-yank-behavior' is one of 'supercite or 'autosupercite. | |
1021 Otherwise, simply insert MH-INS-STRING before each line." | |
1022 (goto-char (point-min)) | |
1023 (cond ((or (eq mh-yank-behavior 'supercite) | |
1024 (eq mh-yank-behavior 'autosupercite)) | |
1025 (sc-cite-original)) | |
1026 (mail-citation-hook | |
1027 (run-hooks 'mail-citation-hook)) | |
1028 (mh-yank-hooks ;old hook name | |
1029 (run-hooks 'mh-yank-hooks)) | |
1030 (t | |
1031 (or (bolp) (forward-line 1)) | |
1032 (while (< (point) (point-max)) | |
1033 (insert mh-ins-string) | |
1034 (forward-line 1)) | |
1035 (goto-char (point-min))))) ;leave point like sc-cite-original | |
1036 | |
1037 (provide 'mh-letter) | |
1038 | |
1039 ;; Local Variables: | |
1040 ;; indent-tabs-mode: nil | |
1041 ;; sentence-end-double-space: nil | |
1042 ;; End: | |
1043 | |
68470 | 1044 ;; arch-tag: 0548632c-aadb-4e3b-bb80-bbd62ff90bf3 |
68465 | 1045 ;;; mh-letter.el ends here |