comparison lisp/mh-e/mh-comp.el @ 82839:af7dc7457402

add mh-annotate-msg-hook
author Stephen Gildea <gildea@stop.mail-abuse.org>
date Sat, 25 Aug 2007 14:12:58 +0000
parents 6cd0b704b471
children 794e428cd497 b83d0dadb2a7
comparison
equal deleted inserted replaced
82838:fccd8136f3d6 82839:af7dc7457402
133 (defvar mh-annotate-char nil 133 (defvar mh-annotate-char nil
134 "Character to use to annotate `mh-sent-from-msg'.") 134 "Character to use to annotate `mh-sent-from-msg'.")
135 135
136 (defvar mh-annotate-field nil 136 (defvar mh-annotate-field nil
137 "Field name for message annotation.") 137 "Field name for message annotation.")
138
139 (defvar mh-annotate-list nil
140 "Messages annotated, either a sequence name or a list of message numbers.
141 This variable can be used by `mh-annotate-msg-hook'.")
138 142
139 (defvar mh-insert-auto-fields-done-local nil 143 (defvar mh-insert-auto-fields-done-local nil
140 "Buffer-local variable set when `mh-insert-auto-fields' called successfully.") 144 "Buffer-local variable set when `mh-insert-auto-fields' called successfully.")
141 (make-variable-buffer-local 'mh-insert-auto-fields-done-local) 145 (make-variable-buffer-local 'mh-insert-auto-fields-done-local)
142 146
973 "Move cursor to first header field if are using the no prompt mode." 977 "Move cursor to first header field if are using the no prompt mode."
974 (unless mh-compose-prompt-flag 978 (unless mh-compose-prompt-flag
975 (goto-char (point-max)) 979 (goto-char (point-max))
976 (mh-letter-next-header-field))) 980 (mh-letter-next-header-field)))
977 981
978 (defun mh-annotate-msg (msg buffer note &rest args) 982 (defun mh-annotate-msg (msg folder note &rest args)
979 "Mark MSG in BUFFER with character NOTE and annotate message with ARGS. 983 "Mark MSG in FOLDER with character NOTE and annotate message with ARGS.
980 MSG can be a message number, a list of message numbers, or a 984 MSG can be a message number, a list of message numbers, or a sequence.
981 sequence." 985 The hook `mh-annotate-msg-hook' is run after annotating; see its
982 (apply 'mh-exec-cmd "anno" buffer 986 documentation for variables it can use."
987 (apply 'mh-exec-cmd "anno" folder
983 (if (listp msg) (append msg args) (cons msg args))) 988 (if (listp msg) (append msg args) (cons msg args)))
984 (save-excursion 989 (save-excursion
985 (cond ((get-buffer buffer) ; Buffer may be deleted 990 (cond ((get-buffer folder) ; Buffer may be deleted
986 (set-buffer buffer) 991 (set-buffer folder)
987 (mh-iterate-on-range nil msg 992 (mh-iterate-on-range nil msg
988 (mh-notate nil note 993 (mh-notate nil note
989 (+ mh-cmd-note mh-scan-field-destination-offset))))))) 994 (+ mh-cmd-note mh-scan-field-destination-offset))))))
995 (let ((mh-current-folder folder)
996 ;; mh-annotate-list is a sequence name or a list of message numbers
997 (mh-annotate-list (if (numberp msg) (list msg) msg)))
998 (run-hooks 'mh-annotate-msg-hook)))
990 999
991 (defun mh-insert-header-separator () 1000 (defun mh-insert-header-separator ()
992 "Insert `mh-mail-header-separator', if absent." 1001 "Insert `mh-mail-header-separator', if absent."
993 (save-excursion 1002 (save-excursion
994 (goto-char (point-min)) 1003 (goto-char (point-min))