From 6e78f2356811a237efe323789441d9c1da9d9bc3 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Thu, 6 Dec 2012 22:29:29 +0000 Subject: [PATCH] gnus-start.el (gnus-before-resume-hook): Add. (gnus-1): Run it when Gnus is alive. --- lisp/ChangeLog | 5 +++++ lisp/gnus-start.el | 11 ++++++++++- texi/gnus.texi | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9a3c1a379..e9ad5c249 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-12-06 Sam Steingold + + * gnus-start.el (gnus-before-resume-hook): Add. + (gnus-1): Run it when Gnus is alive. + 2012-12-05 Katsumi Yamaoka * gmm-utils.el (gmm-called-interactively-p): Restore as a macro. diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index 7514e7ae6..4098bc9f0 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -395,7 +395,15 @@ This hook is called after Gnus is connected to the NNTP server." (defcustom gnus-before-startup-hook nil "A hook called before startup. -This hook is called as the first thing when Gnus is started." +This hook is called as the first thing when Gnus is started. +See also `gnus-before-resume-hook'." + :group 'gnus-start + :type 'hook) + +(defcustom gnus-before-resume-hook nil + "A hook called before resuming Gnus after suspend. +This hook is called as the first thing when Gnus is resumed after a suspend. +See also `gnus-before-startup-hook'." :group 'gnus-start :type 'hook) @@ -749,6 +757,7 @@ prompt the user for the name of an NNTP server to use." (if (gnus-alive-p) (progn + (gnus-run-hooks 'gnus-before-resume-hook) (switch-to-buffer gnus-group-buffer) (gnus-group-get-new-news (and (numberp arg) diff --git a/texi/gnus.texi b/texi/gnus.texi index 788373ccb..2db21e8fb 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -1580,6 +1580,10 @@ times you start Gnus. @vindex gnus-before-startup-hook A hook called as the first thing when Gnus is started. +@item gnus-before-resume-hook +@vindex gnus-before-resume-hook +A hook called as the first thing when Gnus is resumed after a suspend. + @item gnus-startup-hook @vindex gnus-startup-hook A hook run as the very last thing after starting up Gnus -- 2.25.1