# HG changeset patch # User Richard M. Stallman # Date 816024090 0 # Node ID 5c500f39271cd8690cf0aa759052617eea8a01d7 # Parent 23173d03180b561277dc33f6bceb1637d5fe204d (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. diff -r 23173d03180b -r 5c500f39271c lisp/mail/rmail.el --- a/lisp/mail/rmail.el Fri Nov 10 17:19:47 1995 +0000 +++ b/lisp/mail/rmail.el Fri Nov 10 17:21:30 1995 +0000 @@ -112,6 +112,24 @@ (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 @@ (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 @@ 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