[gnus git] branch master updated: m0-5-5-g4bd325e =1= Fix "groups" Agent format
Lars Magne Ingebrigtsen <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via 4bd325ec34ebf9a2f112044e8b0acb6891c9566e (commit)
from 789c31bee0f2558e907a9d174afae38fc44092d6 (commit)
- Log -----------------------------------------------------------------
commit 4bd325ec34ebf9a2f112044e8b0acb6891c9566e
Author: Wolfgang Jenkner <[email protected]>
Date: Sun May 13 21:17:19 2012 +0200
Fix "groups" Agent format
* gnus-agent.el (gnus-agent-save-active): Deal with the "groups"
format. In particular, add an optional argument and a docstring.
* gnus-start.el (gnus-groups-to-gnus-format): Use it.
* nntp.el (nntp-finish-retrieve-group-infos): Make `nntp-server-buffer'
current before calling `gnus-groups-to-gnus-format'.
Note that this was already the case for `gnus-active-to-gnus-format'.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 23e4235..71fdb99 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
+2011-12-02 Wolfgang Jenkner <[email protected]>
+
+ * gnus-agent.el (gnus-agent-save-active): Deal with the "groups"
+ format. In particular, add an optional argument and a docstring.
+
+ * gnus-start.el (gnus-groups-to-gnus-format): Use it.
+
+ * nntp.el (nntp-finish-retrieve-group-infos): Make `nntp-server-buffer'
+ current before calling `gnus-groups-to-gnus-format'.
+ Note that this was already the case for `gnus-active-to-gnus-format'.
+
2012-05-04 Paul Eggert <[email protected]>
Fix minor Y10k bug.
diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el
index 4e4f6cb..540a97b 100644
--- a/lisp/gnus-agent.el
+++ b/lisp/gnus-agent.el
@@ -1299,12 +1299,18 @@ This can be added to `gnus-select-article-hook' or
(gnus-group-update-group group t)))
nil))
-(defun gnus-agent-save-active (method)
+(defun gnus-agent-save-active (method &optional groups-p)
+ "Sync the agent's active file with the current buffer.
+Pass non-nil for GROUPS-P if the buffer starts out in groups format.
+Regardless, both the file and the buffer end up in active format
+if METHOD is agentized; otherwise the function is a no-op."
(when (gnus-agent-method-p method)
(let* ((gnus-command-method method)
(new (gnus-make-hashtable (count-lines (point-min) (point-max))))
(file (gnus-agent-lib-file "active")))
- (gnus-active-to-gnus-format nil new)
+ (if groups-p
+ (gnus-groups-to-gnus-format nil new)
+ (gnus-active-to-gnus-format nil new))
(gnus-agent-write-active file new)
(erase-buffer)
(let ((nnheader-file-coding-system gnus-agent-file-coding-system))
diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el
index 4a833e0..fc32e18 100644
--- a/lisp/gnus-start.el
+++ b/lisp/gnus-start.el
@@ -2221,7 +2221,7 @@ backend check whether the group actually exists."
(gnus-online method)
(gnus-agent-method-p method))
(progn
- (gnus-agent-save-active method)
+ (gnus-agent-save-active method t)
(gnus-active-to-gnus-format method hashtb nil real-active))
(goto-char (point-min))
diff --git a/lisp/nntp.el b/lisp/nntp.el
index d2c7654..592b446 100644
--- a/lisp/nntp.el
+++ b/lisp/nntp.el
@@ -809,7 +809,8 @@ command whose response triggered the error."
(progn
(nntp-copy-to-buffer nntp-server-buffer
(point-min) (point-max))
- (gnus-groups-to-gnus-format method gnus-active-hashtb t))
+ (with-current-buffer nntp-server-buffer
+ (gnus-groups-to-gnus-format method gnus-active-hashtb t)))
;; We have read active entries, so we just delete the
;; superfluous gunk.
(goto-char (point-min))
-----------------------------------------------------------------------
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 | 11 +++++++++++
lisp/gnus-agent.el | 10 ++++++++--
lisp/gnus-start.el | 2 +-
lisp/nntp.el | 3 ++-
4 files changed, 22 insertions(+), 4 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