summaryrefslogtreecommitdiff
path: root/lisp/mail
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-11-10 17:21:30 +0000
committerRichard M. Stallman <rms@gnu.org>1995-11-10 17:21:30 +0000
commit861d9a9740c763c47b8640d61afaf1783c671ae8 (patch)
tree24d493cfba52f79198c307ad2e876b45b5fac2e3 /lisp/mail
parent7baed35392e461c60eb28da73d5b94dd55c509b9 (diff)
downloademacs-861d9a9740c763c47b8640d61afaf1783c671ae8.tar.gz
(rmail-delete-message-hook): New hook.
(rmail-delete-message, rmail-delete-forward): Run the hook. (rmail-mode-hook, rmail-get-new-mail-hook): Add defvars. (rmail-show-message-hook): Likewise.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/rmail.el22
1 files changed, 21 insertions, 1 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index bdd0256768e..fed21ca86bc 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -112,6 +112,24 @@ and the value of the environment variable MAIL overrides it).")
(defvar rmail-secondary-file-regexp "\\.xmail$"
"*Regexp for which files are secondary Rmail files.")
+;;;###autoload
+(defvar rmail-mode-hook nil
+ "List of functions to call when Rmail is invoked.")
+
+;;;###autoload
+(defvar rmail-get-new-mail-hook nil
+ "List of functions to call when Rmail has retrieved new mail.")
+
+;;;###autoload
+(defvar rmail-show-message-hook nil
+ "List of functions to call when Rmail displays a message.")
+
+;;;###autoload
+(defvar rmail-delete-message-hook nil
+ "List of functions to call when Rmail deletes a message.
+When the hooks are called, the message has been marked deleted but is
+still the current message in the Rmail buffer.")
+
;; These may be altered by site-init.el to match the format of mmdf files
;; delimiting used on a given host (delim1 and delim2 from the config
;; files).
@@ -1875,7 +1893,8 @@ If N is negative, go forwards instead."
(defun rmail-delete-message ()
"Delete this message and stay on it."
(interactive)
- (rmail-set-attribute "deleted" t))
+ (rmail-set-attribute "deleted" t)
+ (run-hooks 'rmail-delete-message-hook))
(defun rmail-undelete-previous-message ()
"Back up to deleted message, select it, and undelete it."
@@ -1903,6 +1922,7 @@ With prefix argument, delete and move backward.
Returns t if a new message is displayed after the delete, or nil otherwise."
(interactive "P")
(rmail-set-attribute "deleted" t)
+ (run-hooks 'rmail-delete-message-hook)
(let ((del-msg rmail-current-message))
(if (rmail-summary-exists)
(rmail-select-summary