Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] behavior of gnus-group-make-help-group
@ 2001-11-20 11:54 Didier Verna
  2001-11-21  6:16 ` ShengHuo ZHU
  0 siblings, 1 reply; 2+ messages in thread
From: Didier Verna @ 2001-11-20 11:54 UTC (permalink / raw)



NOTE: This patch is supposed to have been committed. I actually didn't get a
log message, and I can't get diffs. What I get is given below. Could somebody
please confirm ?

 ,----
| cvs [server aborted]: cannot open file gnus-group.el for comparing: No such file or directory
| zsh: exit 1     runsocks cvs diff lisp/gnus-group.el
`-----



		Dear folks,

	When a first-time user types `F' to find new newsgroups, gnus barfs at
him because the help (doc) group already exists. That's because
gnus-group-find-new-newsgroups calls gnus-check-first-time-used, which in turn
tries again to create the help group. The following patch fixes it.

lisp/ChangeLog addition:

2001-11-20  Didier Verna  <didier@xemacs.org>

	* gnus-group.el (gnus-group-make-help-group): new optional
	argument to control the error behavior.
	* gnus-start.el (gnus-check-first-time-used): use it to avoid
	erroring.


Gnus Patch (runsocks cvs -q diff -u -t -b -B -w lisp/gnus-start.el lisp/gnus-group.el):

Index: lisp/gnus-start.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-start.el,v
retrieving revision 6.32
diff -u -u -t -b -B -w -r6.32 gnus-start.el
--- lisp/gnus-start.el	2001/11/12 18:55:22	6.32
+++ lisp/gnus-start.el	2001/11/20 11:39:23
@@ -1218,7 +1218,9 @@
              group gnus-level-default-subscribed gnus-level-killed)))
         (save-excursion
           (set-buffer gnus-group-buffer)
-          (gnus-group-make-help-group))
+          ;; Don't error if the group already exists. This happens when a
+          ;; first-time user types 'F'. -- didier
+          (gnus-group-make-help-group t))
         (when gnus-novice-user
           (gnus-message 7 "`A k' to list killed groups"))))))

Index: lisp/gnus-group.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-group.el,v
retrieving revision 6.46
diff -u -u -t -b -B -w -r6.46 gnus-group.el
--- lisp/gnus-group.el	2001/11/01 14:17:25	6.46
+++ lisp/gnus-group.el	2001/11/20 11:39:23
@@ -2329,20 +2329,33 @@
       (setcar entry (eval (cadar entry)))))
   (gnus-group-make-group group method))

-(defun gnus-group-make-help-group ()
-  "Create the Gnus documentation group."
+(defun gnus-group-make-help-group (&optional noerror)
+  "Create the Gnus documentation group.
+Optional argument NOERROR modifies the behavior of this function when the
+group already exists:
+- if not given, and error is signaled,
+- if t, stay silent,
+- if anything else, just print a message."
   (interactive)
   (let ((name (gnus-group-prefixed-name "gnus-help" '(nndoc "gnus-help")))
         (file (nnheader-find-etc-directory "gnus-tut.txt" t)))
-    (when (gnus-gethash name gnus-newsrc-hashtb)
+    (if (gnus-gethash name gnus-newsrc-hashtb)
+        (cond ((eq noerror nil)
       (error "Documentation group already exists"))
+              ((eq noerror t)
+               ;; stay silent
+               )
+              (t
+               (gnus-message 1 "Documentation group already exists")))
+      ;; else:
     (if (not file)
         (gnus-message 1 "Couldn't find doc group")
       (gnus-group-make-group
        (gnus-group-real-name name)
        (list 'nndoc "gnus-help"
              (list 'nndoc-address file)
-             (list 'nndoc-article-type 'mbox)))))
+               (list 'nndoc-article-type 'mbox))))
+      ))
   (gnus-group-position-point))

 (defun gnus-group-make-doc-group (file type)

--
Didier Verna, didier@lrde.epita.fr, http://www.lrde.epita.fr/~didier

EPITA / LRDE, 14-16 rue Voltaire   Tel.+33 (1) 53 14 59 47
94276 Le Kremlin-Bicêtre, France   Fax.+33 (1) 53 14 59 22   didier@xemacs.org



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] behavior of gnus-group-make-help-group
  2001-11-20 11:54 [PATCH] behavior of gnus-group-make-help-group Didier Verna
@ 2001-11-21  6:16 ` ShengHuo ZHU
  0 siblings, 0 replies; 2+ messages in thread
From: ShengHuo ZHU @ 2001-11-21  6:16 UTC (permalink / raw)


Didier Verna <didier@lrde.epita.fr> writes:

> NOTE: This patch is supposed to have been committed. I actually didn't get a
> log message, and I can't get diffs. What I get is given below. Could somebody
> please confirm ?

It is in.

ShengHuo



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-11-21  6:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-20 11:54 [PATCH] behavior of gnus-group-make-help-group Didier Verna
2001-11-21  6:16 ` ShengHuo ZHU

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).