summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Steingold <sds@gnu.org>2012-12-06 13:30:38 -0500
committerSam Steingold <sds@gnu.org>2012-12-06 13:30:38 -0500
commit5b4d7e523f901916392de12fb93b80b6f472de1d (patch)
tree67cd1505887482ded1680d2f65bf698ef4e2a713
parent93852cb0cf22a38d75edeb840e498b3aa6a4d7c9 (diff)
downloademacs-5b4d7e523f901916392de12fb93b80b6f472de1d.tar.gz
* lisp/gnus/gnus-start.el (gnus-before-resume-hook): Add.
(gnus-1): Run it when Gnus is alive.
-rw-r--r--doc/misc/gnus.texi4
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-start.el11
3 files changed, 19 insertions, 1 deletions
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 280819701ef..dfc422479e3 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/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
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 9d93b28420d..2d2d9318bd6 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-06 Sam Steingold <sds@gnu.org>
+
+ * gnus-start.el (gnus-before-resume-hook): Add.
+ (gnus-1): Run it when Gnus is alive.
+
2012-12-06 Katsumi Yamaoka <yamaoka@jpl.org>
* gmm-utils.el (gmm-called-interactively-p): Restore as a macro.
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index eaf17d9e579..a8b6c5b4816 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/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)