Subject: no startup hook corresponding to gnus-suspend-gnus-hook

From: Sam Steingold <[email-masked]>
Date: Wed, 19 Sep 2012 14:16:20 -0400

Gnus v5.13
GNU Emacs 24.2.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2)
 of 2012-09-14 on t520sds

I use these settings to ensure that gnus saves and restores the window
configuration:
--8<---------------cut here---------------start------------->8---
(defvar sds-window-configuration)
(defun sds-window-configuration-save ()
  (setq sds-window-configuration (current-window-configuration)))
(defun sds-window-configuration-restore ()
  (set-window-configuration sds-window-configuration))
(add-hook 'gnus-after-exiting-gnus-hook 'sds-window-configuration-restore)
(add-hook 'gnus-suspend-gnus-hook 'sds-window-configuration-restore)
(add-hook 'gnus-before-startup-hook 'sds-window-configuration-save)
--8<---------------cut here---------------end--------------->8---
alas, `gnus-before-startup-hook' is not run by `gnus' if it is already
alive, i.e., after `gnus-group-suspend'.
this means that when I syspend gnus, I get the window configuration
which was saved when I first started `gnus'.

I wish there were a better way to save-restore the window configuration,
than redefining gnus:
--8<---------------cut here---------------start------------->8---
(defun sds-gnus (&rest args)
  (let ((wc (current-window-configuration)))
    (ignore-errors (apply #'gnus args))
    (set-window-configuration wc)))
--8<---------------cut here---------------end--------------->8---

-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://truepeace.org http://dhimmi.com
http://thereligionofpeace.com http://camera.org http://openvotingconsortium.org
Booze is the answer. I can't remember the question.