[gnus git] branch master updated: m0-3-142-g23eae55 =2= Further fixes for allowing ephemeral groups without Gnus running ; Allow reading ephemeral groups without starting Gnus

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  23eae558c46c7e86257c60f5bcbe7db451ee6c85 (commit)
       via  4d7fbe555d8e1d708ca6f26524e375a488e40fc4 (commit)
      from  cbbae3be0807cdca91fd3c56409288fd7af59ba3 (commit)


- Log -----------------------------------------------------------------
commit 23eae558c46c7e86257c60f5bcbe7db451ee6c85
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Thu Apr 12 18:48:08 2012 +0200

    Further fixes for allowing ephemeral groups without Gnus running
    
    (gnus-summary-exit): Allow quitting when we don't have a group buffer.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e79a9b3..6841b50 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,7 @@
 
 	* gnus-sum.el (gnus-set-global-variables): Don't assume that the group
 	buffer exists, which it doesn't if we haven't started Gnus.
+	(gnus-summary-exit): Allow quitting when we don't have a group buffer.
 
 2012-04-11  Katsumi Yamaoka  <[email protected]>
 
diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el
index 8ce04eb..ca745f4 100644
--- a/lisp/gnus-group.el
+++ b/lisp/gnus-group.el
@@ -2291,6 +2291,9 @@ Return the name of the group if selection was successful."
     (gnus-group-completing-read)
     (gnus-read-method "From method")))
   (unless (gnus-alive-p)
+    (nnheader-init-server-buffer)
+    ;; Necessary because of funky inlining.
+    (require 'gnus-cache)
     (setq gnus-newsrc-hashtb (gnus-make-hashtable)))
   ;; Transform the select method into a unique server.
   (when (stringp method)
diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
index 95b13da..5f9cc3c 100644
--- a/lisp/gnus-sum.el
+++ b/lisp/gnus-sum.el
@@ -7257,7 +7257,8 @@ If FORCE (the prefix), also save the .newsrc file(s)."
       (gnus-summary-update-info))
     (gnus-close-group group)
     ;; Make sure where we were, and go to next newsgroup.
-    (set-buffer gnus-group-buffer)
+    (when (buffer-live-p gnus-group-buffer)
+      (set-buffer gnus-group-buffer))
     (unless quit-config
       (gnus-group-jump-to-group group))
     (gnus-run-hooks 'gnus-summary-exit-hook)
@@ -7282,7 +7283,8 @@ If FORCE (the prefix), also save the .newsrc file(s)."
 	  (gnus-kill-buffer buf)))
 
       (setq gnus-current-select-method gnus-select-method)
-      (set-buffer gnus-group-buffer)
+      (when (buffer-live-p gnus-group-buffer)
+	(set-buffer gnus-group-buffer))
       (if quit-config
 	  (gnus-handle-ephemeral-exit quit-config)
 	(goto-char group-point)

commit 4d7fbe555d8e1d708ca6f26524e375a488e40fc4
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Thu Apr 12 18:40:27 2012 +0200

    Allow reading ephemeral groups without starting Gnus
    
    * gnus-sum.el (gnus-set-global-variables): Don't assume that the group
    buffer exists, which it doesn't if we haven't started Gnus.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cbe96c0..e79a9b3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-12  Lars Magne Ingebrigtsen  <[email protected]>
+
+	* gnus-sum.el (gnus-set-global-variables): Don't assume that the group
+	buffer exists, which it doesn't if we haven't started Gnus.
+
 2012-04-11  Katsumi Yamaoka  <[email protected]>
 
 	pgg-def.el, pgg-gpg.el, pgg-parse.el, pgg-pgp.el, pgg-pgp5.el, pgg.el:
diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el
index 0c3346a..8ce04eb 100644
--- a/lisp/gnus-group.el
+++ b/lisp/gnus-group.el
@@ -2290,9 +2290,9 @@ Return the name of the group if selection was successful."
     ;; (gnus-read-group "Group name: ")
     (gnus-group-completing-read)
     (gnus-read-method "From method")))
-  ;; Transform the select method into a unique server.
   (unless (gnus-alive-p)
-    (gnus-no-server))
+    (setq gnus-newsrc-hashtb (gnus-make-hashtable)))
+  ;; Transform the select method into a unique server.
   (when (stringp method)
     (setq method (gnus-server-to-method method)))
   (let ((address-slot
@@ -2323,7 +2323,8 @@ Return the name of the group if selection was successful."
 		 parameters)))
      gnus-newsrc-hashtb)
     (push method gnus-ephemeral-servers)
-    (set-buffer gnus-group-buffer)
+    (when (buffer-live-p gnus-group-buffer)
+      (set-buffer gnus-group-buffer))
     (unless (gnus-check-server method)
       (error "Unable to contact server: %s" (gnus-status-message method)))
     (when activate
diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el
index 9ce9142..95b13da 100644
--- a/lisp/gnus-sum.el
+++ b/lisp/gnus-sum.el
@@ -3558,7 +3558,7 @@ buffer that was in action when the last article was fetched."
 	    (push (eval (car locals)) vlist))
 	  (setq locals (cdr locals)))
 	(setq vlist (nreverse vlist)))
-      (with-current-buffer gnus-group-buffer
+      (with-temp-buffer
 	(setq gnus-newsgroup-name name
 	      gnus-newsgroup-marked marked
 	      gnus-newsgroup-spam-marked spam
@@ -5683,7 +5683,9 @@ If SELECT-ARTICLES, only select those articles from GROUP."
       ;; Init the dependencies hash table.
       (setq gnus-newsgroup-dependencies
 	    (gnus-make-hashtable (length articles)))
+      (if (buffer-live-p gnus-group-buffer)
       (gnus-set-global-variables)
+	(set-default 'gnus-newsgroup-name gnus-newsgroup-name))
       ;; Retrieve the headers and read them in.
 
       (setq gnus-newsgroup-headers (gnus-fetch-headers articles))

-----------------------------------------------------------------------
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-group.el |   10 +++++++---
 lisp/gnus-sum.el   |   14 +++++++++-----
 3 files changed, 22 insertions(+), 8 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.