[gnus git] branch master updated: m0-5-180-ga2a5a86 =1= * lisp/gnus/gnus.el (gnus-delete-gnus-frame): Extract from `gnus-other-frame'. (gnus-other-frame): Add `gnus-delete-gnus-frame' to `gnus-suspend-gnus-hook' in addition to `gnus-exit-gnus-hook'.

Katsumi Yamaoka <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  a2a5a865a44c8146babf94345d4ff2a8a744440a (commit)
      from  f425eaae412cbfff66b347454f468be207963bb6 (commit)


- Log -----------------------------------------------------------------
commit a2a5a865a44c8146babf94345d4ff2a8a744440a
Author: Sam Steingold <[email protected]>
Date:   Wed Dec 5 23:51:10 2012 +0000

    * lisp/gnus/gnus.el (gnus-delete-gnus-frame): Extract from `gnus-other-frame'.
    (gnus-other-frame): Add `gnus-delete-gnus-frame' to
    `gnus-suspend-gnus-hook' in addition to `gnus-exit-gnus-hook'.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3d1e81c..0af3ca7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-05  Sam Steingold  <[email protected]>
+
+	* gnus.el (gnus-delete-gnus-frame): Extract from `gnus-other-frame'.
+	(gnus-other-frame): Add `gnus-delete-gnus-frame' to
+	`gnus-suspend-gnus-hook' in addition to `gnus-exit-gnus-hook'.
+
 2012-12-05  Katsumi Yamaoka  <[email protected]>
 
 	* gmm-utils.el (gmm-called-interactively-p): Revert.
diff --git a/lisp/gnus.el b/lisp/gnus.el
index 617ccf4..7de6e83 100644
--- a/lisp/gnus.el
+++ b/lisp/gnus.el
@@ -4349,6 +4349,14 @@ server."
   (interactive "P")
   (gnus arg nil 'slave))
 
+(defun gnus-delete-gnus-frame ()
+  "Delete gnus frame unless it is the only one.
+Used for `gnus-exit-gnus-hook' in `gnus-other-frame'."
+  (when (and (frame-live-p gnus-other-frame-object)
+             (cdr (frame-list)))
+    (delete-frame gnus-other-frame-object))
+  (setq gnus-other-frame-object nil))
+
 ;;;###autoload
 (defun gnus-other-frame (&optional arg display)
   "Pop up a frame to read news.
@@ -4389,12 +4397,13 @@ current display is used."
       (if alive
 	  (switch-to-buffer gnus-group-buffer)
 	(funcall gnus-other-frame-function arg)
-	(add-hook 'gnus-exit-gnus-hook
-		  (lambda nil
-                    (when (and (frame-live-p gnus-other-frame-object)
-                               (cdr (frame-list)))
-                      (delete-frame gnus-other-frame-object))
-                    (setq gnus-other-frame-object nil)))))))
+	(add-hook 'gnus-exit-gnus-hook 'gnus-delete-gnus-frame)
+  ;; One might argue that `gnus-delete-gnus-frame' should not be called
+  ;; from `gnus-suspend-gnus-hook', but, on the other hand, one might
+  ;; argue that it should.  No matter what you think, for the sake of
+  ;; those who want it to be called from it, please keep (defun
+  ;; gnus-delete-gnus-frame) even if you remove the next `add-hook'.
+  (add-hook 'gnus-suspend-gnus-hook 'gnus-delete-gnus-frame)))))
 
 ;;;###autoload
 (defun gnus (&optional arg dont-connect slave)

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    6 ++++++
 lisp/gnus.el   |   21 +++++++++++++++------
 2 files changed, 21 insertions(+), 6 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.