summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/mh-e/ChangeLog7
-rw-r--r--lisp/mh-e/mh-comp.el25
-rw-r--r--lisp/mh-e/mh-e.el9
3 files changed, 33 insertions, 8 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 4e25ce1a086..956f7b39cf1 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,10 @@
+2007-08-25 Stephen Gildea <gildea@stop.mail-abuse.org>
+
+ * mh-e.el (mh-annotate-msg-hook): New variable.
+
+ * mh-comp.el (mh-annotate-msg): Call new mh-annotate-msg-hook.
+ (mh-annotate-list): New variable, for mh-annotate-msg-hook.
+
2007-08-21 Jeffrey C Honig <jch@honig.net>
* mh-folder.el (mh-folder-message-menu, mh-folder-mode-map): Add
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index a71de8246c5..bb2d1506adf 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -136,6 +136,10 @@ Used by the \\[mh-edit-again] and \\[mh-extract-rejected-mail] commands.")
(defvar mh-annotate-field nil
"Field name for message annotation.")
+(defvar mh-annotate-list nil
+ "Messages annotated, either a sequence name or a list of message numbers.
+This variable can be used by `mh-annotate-msg-hook'.")
+
(defvar mh-insert-auto-fields-done-local nil
"Buffer-local variable set when `mh-insert-auto-fields' called successfully.")
(make-variable-buffer-local 'mh-insert-auto-fields-done-local)
@@ -975,18 +979,23 @@ This should be the last function called when composing the draft."
(goto-char (point-max))
(mh-letter-next-header-field)))
-(defun mh-annotate-msg (msg buffer note &rest args)
- "Mark MSG in BUFFER with character NOTE and annotate message with ARGS.
-MSG can be a message number, a list of message numbers, or a
-sequence."
- (apply 'mh-exec-cmd "anno" buffer
+(defun mh-annotate-msg (msg folder note &rest args)
+ "Mark MSG in FOLDER with character NOTE and annotate message with ARGS.
+MSG can be a message number, a list of message numbers, or a sequence.
+The hook `mh-annotate-msg-hook' is run after annotating; see its
+documentation for variables it can use."
+ (apply 'mh-exec-cmd "anno" folder
(if (listp msg) (append msg args) (cons msg args)))
(save-excursion
- (cond ((get-buffer buffer) ; Buffer may be deleted
- (set-buffer buffer)
+ (cond ((get-buffer folder) ; Buffer may be deleted
+ (set-buffer folder)
(mh-iterate-on-range nil msg
(mh-notate nil note
- (+ mh-cmd-note mh-scan-field-destination-offset)))))))
+ (+ mh-cmd-note mh-scan-field-destination-offset))))))
+ (let ((mh-current-folder folder)
+ ;; mh-annotate-list is a sequence name or a list of message numbers
+ (mh-annotate-list (if (numberp msg) (list msg) msg)))
+ (run-hooks 'mh-annotate-msg-hook)))
(defun mh-insert-header-separator ()
"Insert `mh-mail-header-separator', if absent."
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 0d163de0eba..8c8446e1b7c 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -3032,6 +3032,15 @@ folder, which is also available in `mh-current-folder'."
:group 'mh-alias
:package-version '(MH-E . "8.0"))
+(defcustom-mh mh-annotate-msg-hook nil
+ "Hook run by `mh-annotate-msg' after annotation.
+Variables that are useful in this hook include `mh-current-folder',
+the current folder, and `mh-annotate-list', the messages annotated."
+ :type 'hook
+ :group 'mh-hooks
+ :group 'mh-sending-mail
+ :package-version '(MH-E . "8.1"))
+
(defcustom-mh mh-before-commands-processed-hook nil
"Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding refile and delete requests.