Gnus development mailing list
 help / color / mirror / Atom feed
* `M-g' when `nntp-server-list-active-group' is nil
@ 1998-08-15 12:06 Mike McEwan
  0 siblings, 0 replies; only message in thread
From: Mike McEwan @ 1998-08-15 12:06 UTC (permalink / raw)


  Well I thought I'd be able to download articles for individual
groups and have their `active' files saved accross sesions when I
read:

"* gnus-group.el (gnus-group-get-new-news-this-group): Store active
	info."

  However, me being awkward with `nntp-server-list-active-group' set
to `nil' (my isp's news-server seems to have a noticeable lag in
updating its active file) , my "agent.lib/groups" file was still not
being updated after a `M-g' in the group buffer. The following patch
rectifies the situation:

diff -u ChangeLog.orig ChangeLog
--- ChangeLog.orig	1998/08/15 08:24:01
+++ ChangeLog	1998/08/15 11:35:17
@@ -1,3 +1,8 @@
+1998-08-15  Mike McEwan  <mike@lotusland.demon.co.uk>
+
+	* gnus-agent.el (gnus-agent-save-group-info): Update "groups" file 
+	if `nntp-server-list-active-group' is nil.
+
 Fri Aug 14 23:03:51 1998  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
 	* gnus.el: Gnus v5.6.36 is released.
diff -u gnus-agent.el.orig gnus-agent.el
--- gnus-agent.el.orig	1998/08/15 08:34:05
+++ gnus-agent.el	1998/08/15 11:09:11
@@ -532,16 +532,24 @@
 (defun gnus-agent-save-group-info (method group active)
   (when (gnus-agent-method-p method)
     (let* ((gnus-command-method method)
-	   (file (gnus-agent-lib-file "active")))
+	   (file (if nntp-server-list-active-group
+		     (gnus-agent-lib-file "active")
+		   (gnus-agent-lib-file "groups"))))
       (gnus-make-directory (file-name-directory file))
       (nnheader-temp-write file
 	(when (file-exists-p file)
 	  (insert-file-contents file))
 	(goto-char (point-min))
-	(when (re-search-forward (concat "^" (regexp-quote group) " ") nil t)
-	  (gnus-delete-line))
-	(insert group " " (number-to-string (cdr active)) " "
-		(number-to-string (car active)) "\n")))))
+	(if nntp-server-list-active-group
+	    (progn
+	      (when (re-search-forward (concat "^" (regexp-quote group) " ") nil t)
+		(gnus-delete-line))
+	      (insert group " " (number-to-string (cdr active)) " "
+		      (number-to-string (car active)) "\n"))
+	  (progn
+	    (when (re-search-forward (concat (regexp-quote group) " ") nil t)
+	      (gnus-delete-line))
+	    (insert-buffer-substring nntp-server-buffer)))))))
 
 (defun gnus-agent-group-path (group)
   "Translate GROUP into a path."

-- 
Mike.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-08-15 12:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-15 12:06 `M-g' when `nntp-server-list-active-group' is nil Mike McEwan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).