aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gildea2007-08-25 14:12:58 +0000
committerStephen Gildea2007-08-25 14:12:58 +0000
commitaad5673d98cb0de9a2dd0d5ea18f8179117e5fe6 (patch)
tree09856d3535cfb7c31118be39b50da51bf79094b7
parent1ae0abbc93d80ea8ccd81894ae104ed9ab865a20 (diff)
downloademacs-aad5673d98cb0de9a2dd0d5ea18f8179117e5fe6.tar.gz
emacs-aad5673d98cb0de9a2dd0d5ea18f8179117e5fe6.zip
add mh-annotate-msg-hook
-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 @@
12007-08-25 Stephen Gildea <gildea@stop.mail-abuse.org>
2
3 * mh-e.el (mh-annotate-msg-hook): New variable.
4
5 * mh-comp.el (mh-annotate-msg): Call new mh-annotate-msg-hook.
6 (mh-annotate-list): New variable, for mh-annotate-msg-hook.
7
12007-08-21 Jeffrey C Honig <jch@honig.net> 82007-08-21 Jeffrey C Honig <jch@honig.net>
2 9
3 * mh-folder.el (mh-folder-message-menu, mh-folder-mode-map): Add 10 * 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.")
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 138
139(defvar mh-annotate-list nil
140 "Messages annotated, either a sequence name or a list of message numbers.
141This variable can be used by `mh-annotate-msg-hook'.")
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)
@@ -975,18 +979,23 @@ This should be the last function called when composing the draft."
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.
980MSG can be a message number, a list of message numbers, or a 984MSG can be a message number, a list of message numbers, or a sequence.
981sequence." 985The hook `mh-annotate-msg-hook' is run after annotating; see its
982 (apply 'mh-exec-cmd "anno" buffer 986documentation 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."
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'."
3032 :group 'mh-alias 3032 :group 'mh-alias
3033 :package-version '(MH-E . "8.0")) 3033 :package-version '(MH-E . "8.0"))
3034 3034
3035(defcustom-mh mh-annotate-msg-hook nil
3036 "Hook run by `mh-annotate-msg' after annotation.
3037Variables that are useful in this hook include `mh-current-folder',
3038the current folder, and `mh-annotate-list', the messages annotated."
3039 :type 'hook
3040 :group 'mh-hooks
3041 :group 'mh-sending-mail
3042 :package-version '(MH-E . "8.1"))
3043
3035(defcustom-mh mh-before-commands-processed-hook nil 3044(defcustom-mh mh-before-commands-processed-hook nil
3036 "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding refile and delete requests. 3045 "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding refile and delete requests.
3037 3046