]> diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/miscellany/mhe/mh-annot.ml
Always check that mktemp()/mktemp2() succeeds before trying to
[nmh] / docs / historical / mh-6.8.5 / miscellany / mhe / mh-annot.ml
1 ; This autoloaded file implementes the (annotate) function of mhe
2 ;
3 ; Insert into the current buffer, at the current cursor position,
4 ; a message header annotation like "Replied: <<26-Apr-82 09:22>>"
5 ; Argument 1 is the annotation field string, e.g. "Replied".
6 ; Argument 2 is an annotation comment field, to be put before the date
7 (defun
8 (annotate
9 (save-excursion
10 (temp-use-buffer "message")
11 (beginning-of-file)
12 (insert-string
13 (concat (arg 1) ": "
14 (if (> (nargs) 1)
15 (concat (arg 2) " ")
16 "")
17 (arpa-fmt-date)
18 "\n")
19 )
20 (write-current-file)
21 (temp-use-buffer (concat "+" mh-folder))
22 (beginning-of-line)
23 (goto-character (+ (dot) 4))
24 (delete-next-character)
25 (insert-character (string-to-char (arg 1)))
26 (setq buffer-is-modified 0)
27 )
28 )
29 (arpa-fmt-date cd
30 (setq cd (current-time)); "Mon Apr 26 09:13:37 1982"
31 (concat
32 (substr cd 9 2) " "
33 (substr cd 5 3) " "
34 (substr cd -2 2) " "
35 (substr cd 12 5)
36 )
37 )
38 )