GNU bug report logs - #9691
When `gnus-registry-install' is 'ask, nnregistry is broken

Previous Next

Package: gnus;

Reported by: Dave Abrahams <dave <at> boostpro.com>

Date: Fri, 7 Oct 2011 12:08:02 UTC

Severity: normal

Tags: fixed

Found in version 5.110018

Fixed in version 24.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9691 in the body.
You can then email your comments to 9691 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bugs <at> gnus.org:
bug#9691; Package gnus. (Fri, 07 Oct 2011 12:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dave Abrahams <dave <at> boostpro.com>:
New bug report received and forwarded. Copy sent to bugs <at> gnus.org. (Fri, 07 Oct 2011 12:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dave Abrahams <dave <at> boostpro.com>
To: submit <at> debbugs.gnu.org (The Gnus Bugfixing Girls + Boys)
Subject: When `gnus-registry-install' is 'ask, nnregistry is broken
Date: Fri, 07 Oct 2011 08:07:02 -0400
nnregistry checks for (eq gnus-registry-install t) and nothing ever
changes gnus-registry-install from ask to t.  Given that
gnus-registry-install is a customization option I think a separate
variable is warranted, e.g. gnus-registry-installed.


No Gnus v0.18
GNU Emacs 23.3.1 (x86_64-apple-darwin10.8.0, Carbon Version 1.6.0 AppKit 1038.36)
 of 2011-09-12 on pluto.luannocracy.com
200 Leafnode NNTP Daemon, version 1.11.8 running at localhost (my fqdn: pluto.boostpro.com)
500 Unknown command

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com





Information forwarded to bugs <at> gnus.org:
bug#9691; Package gnus. (Fri, 07 Oct 2011 12:23:02 GMT) Full text and rfc822 format available.

Message #8 received at 9691 <at> debbugs.gnu.org (full text, mbox):

From: Dave Abrahams <dave <at> boostpro.com>
To: 9691 <at> debbugs.gnu.org
Subject: Re: bug#9691: Acknowledgement (When `gnus-registry-install' is 'ask,
	nnregistry is broken)
Date: Fri, 07 Oct 2011 08:22:20 -0400
Hah!  It's even more twisted...

gnus-registry-install-shortcuts is the place where we call
(gnus-registry-install-p), which is the one place we check

  (eq gnus-registry-install 'ask)

to see whether to ask the user about installation.  However, the only
place where gnus-registry-install-shortcuts is called is
gnus-registry-initialize:

--8<---------------cut here---------------start------------->8---
;;;###autoload
(defun gnus-registry-initialize ()
"Initialize the Gnus registry."
  (interactive)
  (gnus-message 5 "Initializing the registry")
  (setq gnus-registry-install t)        ; in case it was 'ask or nil
  (gnus-registry-install-hooks)
  (gnus-registry-install-shortcuts)
  (gnus-registry-read))
--8<---------------cut here---------------end--------------->8---

Notice how gnus-registry-initialize sets gnus-registry-install to t
/before/ calling gnus-registry-install-shortcuts?  That means nobody
will ever get asked.

Further on down the road, various parts of Gnus look directly at
gnus-registry-install in various and sundry ways:

--8<---------------cut here---------------start------------->8---
(defun nnmairix-determine-original-group-from-registry (mid)
  "Try to determinale original group for message-id MID from the registry."
  (when (and (boundp 'gnus-registry-install)
	     gnus-registry-install)
--8<---------------cut here---------------end--------------->8---
[essentially (bound-and-true-p gnus-registry-install)]

--8<---------------cut here---------------start------------->8---
(defun nnir-mode ()
  (when (eq (car (gnus-find-method-for-group gnus-newsgroup-name)) 'nnir)
    (setq gnus-summary-line-format
	  (or nnir-summary-line-format gnus-summary-line-format))
    (when (and (boundp 'gnus-registry-install)
		       (eq gnus-registry-install t))
--8<---------------cut here---------------end--------------->8---

and finally:

--8<---------------cut here---------------start------------->8---
(deffoo nnregistry-server-opened (server)
  (eq gnus-registry-install t))

(deffoo nnregistry-open-server (server &optional defs)
  (eq gnus-registry-install t))
--8<---------------cut here---------------end--------------->8---

It's a mess and I don't know what should be done.




Information forwarded to bugs <at> gnus.org:
bug#9691; Package gnus. (Sun, 09 Oct 2011 02:57:01 GMT) Full text and rfc822 format available.

Message #11 received at 9691 <at> debbugs.gnu.org (full text, mbox):

From: Dave Abrahams <dave <at> boostpro.com>
To: 9691 <at> debbugs.gnu.org
Cc: Ted Zlatanov <tzz <at> lifelogs.com>
Subject: Patch Enclosed (When `gnus-registry-install' is 'ask,
	nnregistry is broken)
Date: Sat, 08 Oct 2011 22:55:56 -0400
[Message part 1 (text/plain, inline)]
Here is my proposed fix for this problem:

[0001-Rationalize-the-use-of-gnus-registry-install.patch (text/x-patch, inline)]
From dc140ae8315ef7ab9ca07123d94cd40c507c6763 Mon Sep 17 00:00:00 2001
From: Dave Abrahams <dave <at> boostpro.com>
Date: Sat, 8 Oct 2011 22:50:18 -0400
Subject: [PATCH] Rationalize the use of `gnus-registry-install'

- don't programmatically change `gnus-registry-install' (at least not
  permanently), because it's a user option.

- use a new variable, `gnus-registry-enabled', to indicate whether the
  registry is active.

- replace checks of `gnus-registry-install' with checks of
  `gnus-registry-enabled'

This also fixes the bug that with the default setting of
`gnus-registry-install' (`ask'), the nnregistry server is stuck at
`denied'.
---
 lisp/gnus-registry.el |   33 +++++++++++++++++++--------------
 lisp/nnir.el          |    6 ++----
 lisp/nnmairix.el      |    4 +---
 lisp/nnregistry.el    |    7 +++++--
 4 files changed, 27 insertions(+), 23 deletions(-)

diff --git a/lisp/gnus-registry.el b/lisp/gnus-registry.el
index f8ff52f..652e816 100644
--- a/lisp/gnus-registry.el
+++ b/lisp/gnus-registry.el
@@ -164,6 +164,8 @@ nnmairix groups are specifically excluded because they are ephemeral."
                  (const :tag "Always Install" t)
                  (const :tag "Ask Me" ask)))
 
+(defvar gnus-registry-enabled)
+
 (defvar gnus-summary-misc-menu) ;; Avoid byte compiler warning.
 
 (defvar gnus-registry-misc-menus nil)   ; ugly way to keep the menus
@@ -873,8 +875,9 @@ Uses `gnus-registry-marks' to find what shortcuts to install."
 
                  ;; if this is called and the user doesn't want the
                  ;; registry enabled, we'll ask anyhow
-                 (when (eq gnus-registry-install nil)
-                   (setq gnus-registry-install 'ask))
+                 (unless gnus-registry-install
+                   (let ((gnus-registry-install 'ask))
+                     (gnus-registry-install-p)))
 
                  ;; now the user is asked if gnus-registry-install is 'ask
                  (when (gnus-registry-install-p)
@@ -1151,7 +1154,6 @@ only the last one's marks are returned."
 "Initialize the Gnus registry."
   (interactive)
   (gnus-message 5 "Initializing the registry")
-  (setq gnus-registry-install t)        ; in case it was 'ask or nil
   (gnus-registry-install-hooks)
   (gnus-registry-install-shortcuts)
   (gnus-registry-read))
@@ -1160,6 +1162,7 @@ only the last one's marks are returned."
 (defun gnus-registry-install-hooks ()
   "Install the registry hooks."
   (interactive)
+  (setq gnus-registry-enabled t)
   (add-hook 'gnus-summary-article-move-hook 'gnus-registry-action)
   (add-hook 'gnus-summary-article-delete-hook 'gnus-registry-action)
   (add-hook 'gnus-summary-article-expire-hook 'gnus-registry-action)
@@ -1181,23 +1184,25 @@ only the last one's marks are returned."
   (remove-hook 'gnus-save-newsrc-hook 'gnus-registry-save)
   (remove-hook 'gnus-read-newsrc-el-hook 'gnus-registry-read)
 
-  (remove-hook 'gnus-summary-prepare-hook 'gnus-registry-register-message-ids))
+  (remove-hook 'gnus-summary-prepare-hook 'gnus-registry-register-message-ids)
+  (setq gnus-registry-enabled nil))
 
 (add-hook 'gnus-registry-unload-hook 'gnus-registry-unload-hook)
 
 (defun gnus-registry-install-p ()
+  "If the registry is not already enabled, and `gnus-registry-install' is t,
+the registry is enabled.  If `gnus-registry-install' is `ask',
+the user is asked first.  Returns non-nil iff the registry is enabled."
   (interactive)
-  (when (eq gnus-registry-install 'ask)
-    (setq gnus-registry-install
-          (gnus-y-or-n-p
-           (concat "Enable the Gnus registry?  "
-                   "See the variable `gnus-registry-install' "
-                   "to get rid of this query permanently. ")))
-    (when gnus-registry-install
-      ;; we just set gnus-registry-install to t, so initialize the registry!
+  (unless gnus-registry-enabled
+    (when (if (eq gnus-registry-install 'ask)
+              (gnus-y-or-n-p
+               (concat "Enable the Gnus registry?  "
+                       "See the variable `gnus-registry-install' "
+                       "to get rid of this query permanently. "))
+            gnus-registry-install)
       (gnus-registry-initialize)))
-;;; we could call it here: (customize-variable 'gnus-registry-install)
-  gnus-registry-install)
+  gnus-registry-enabled)
 
 ;; TODO: a few things
 
diff --git a/lisp/nnir.el b/lisp/nnir.el
index 0be6a17..cbd3f74 100644
--- a/lisp/nnir.el
+++ b/lisp/nnir.el
@@ -290,8 +290,7 @@ is `(valuefunc member)'."
   (autoload 'nnimap-command "nnimap")
   (autoload 'nnimap-possibly-change-group "nnimap")
   (autoload 'nnimap-make-thread-query "nnimap")
-  (autoload 'gnus-registry-action "gnus-registry")
-  (defvar gnus-registry-install))
+  (autoload 'gnus-registry-action "gnus-registry"))
 
 
 (nnoo-declare nnir)
@@ -1741,8 +1740,7 @@ environment unless `not-global' is non-nil."
   (when (eq (car (gnus-find-method-for-group gnus-newsgroup-name)) 'nnir)
     (setq gnus-summary-line-format
 	  (or nnir-summary-line-format gnus-summary-line-format))
-    (when (and (boundp 'gnus-registry-install)
-		       (eq gnus-registry-install t))
+    (when (bound-and-true-p gnus-registry-enabled)
       (remove-hook 'gnus-summary-article-delete-hook 'gnus-registry-action t)
       (remove-hook 'gnus-summary-article-move-hook 'gnus-registry-action t)
       (remove-hook 'gnus-summary-article-expire-hook 'gnus-registry-action t)
diff --git a/lisp/nnmairix.el b/lisp/nnmairix.el
index 3d1ac02..f81aa03 100644
--- a/lisp/nnmairix.el
+++ b/lisp/nnmairix.el
@@ -603,7 +603,6 @@ Other back ends might or might not work.")
     nil))
 
 ;; Silence byte-compiler.
-(defvar gnus-registry-install)
 (autoload 'gnus-registry-get-id-key "gnus-registry")
 
 (deffoo nnmairix-request-set-mark (group actions &optional server)
@@ -1636,8 +1635,7 @@ search in raw mode."
 
 (defun nnmairix-determine-original-group-from-registry (mid)
   "Try to determinale original group for message-id MID from the registry."
-  (when (and (boundp 'gnus-registry-install)
-	     gnus-registry-install)
+  (when (bound-and-true-p gnus-registry-enabled)
     (unless (string-match "^<" mid)
       (set mid (concat "<" mid)))
     (unless (string-match ">$" mid)
diff --git a/lisp/nnregistry.el b/lisp/nnregistry.el
index 359050c..75a640a 100644
--- a/lisp/nnregistry.el
+++ b/lisp/nnregistry.el
@@ -36,8 +36,11 @@
 
 (nnoo-declare nnregistry)
 
+;; Suppress byte-compiler warning `reference to free variable'
+(defvar gnus-registry-enabled)
+
 (deffoo nnregistry-server-opened (server)
-  (eq gnus-registry-install t))
+  gnus-registry-enabled)
 
 (deffoo nnregistry-close-server (server)
   t)
@@ -46,7 +49,7 @@
   nil)
 
 (deffoo nnregistry-open-server (server &optional defs)
-  (eq gnus-registry-install t))
+  gnus-registry-enabled)
 
 (defvar nnregistry-within-nnregistry nil)
 
-- 
1.7.3.4

[Message part 3 (text/plain, inline)]
-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com


Information forwarded to bugs <at> gnus.org:
bug#9691; Package gnus. (Fri, 14 Oct 2011 20:52:02 GMT) Full text and rfc822 format available.

Message #14 received at 9691 <at> debbugs.gnu.org (full text, mbox):

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Dave Abrahams <dave <at> boostpro.com>, Ted Zlatanov <tzz <at> lifelogs.com>
Cc: 9691 <at> debbugs.gnu.org
Subject: Re: Patch Enclosed (When `gnus-registry-install' is 'ask,
	nnregistry is broken)
Date: Fri, 14 Oct 2011 15:28:21 -0500
On Sat, 08 Oct 2011 22:55:56 -0400 Dave Abrahams <dave <at> boostpro.com> wrote: 

DA> Here is my proposed fix for this problem:

DA> From dc140ae8315ef7ab9ca07123d94cd40c507c6763 Mon Sep 17 00:00:00 2001
DA> From:  Dave Abrahams <dave <at> boostpro.com>
DA> Date: Sat, 8 Oct 2011 22:50:18 -0400
DA> Subject: [PATCH] Rationalize the use of `gnus-registry-install'

DA> - don't programmatically change `gnus-registry-install' (at least not
DA>   permanently), because it's a user option.

DA> - use a new variable, `gnus-registry-enabled', to indicate whether the
DA>   registry is active.

DA> - replace checks of `gnus-registry-install' with checks of
DA>   `gnus-registry-enabled'

DA> This also fixes the bug that with the default setting of
DA> `gnus-registry-install' (`ask'), the nnregistry server is stuck at
DA> `denied'.

This is very nice, thank you.  I'll commit it.  We're in a feature
freeze but I think it's more of a bug fix than a feature.

Ted




Information forwarded to bugs <at> gnus.org:
bug#9691; Package gnus. (Mon, 17 Oct 2011 17:27:01 GMT) Full text and rfc822 format available.

Message #17 received at 9691 <at> debbugs.gnu.org (full text, mbox):

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Dave Abrahams <dave <at> boostpro.com>
Cc: 9691 <at> debbugs.gnu.org
Subject: Re: Patch Enclosed (When `gnus-registry-install' is 'ask,
	nnregistry is broken)
Date: Mon, 17 Oct 2011 13:25:12 -0400
On Fri, 14 Oct 2011 15:28:21 -0500 Ted Zlatanov <tzz <at> lifelogs.com> wrote: 

TZ> On Sat, 08 Oct 2011 22:55:56 -0400 Dave Abrahams <dave <at> boostpro.com> wrote: 
DA> Here is my proposed fix for this problem:

DA> From dc140ae8315ef7ab9ca07123d94cd40c507c6763 Mon Sep 17 00:00:00 2001
DA> From:  Dave Abrahams <dave <at> boostpro.com>
DA> Date: Sat, 8 Oct 2011 22:50:18 -0400
DA> Subject: [PATCH] Rationalize the use of `gnus-registry-install'

DA> - don't programmatically change `gnus-registry-install' (at least not
DA> permanently), because it's a user option.

DA> - use a new variable, `gnus-registry-enabled', to indicate whether the
DA> registry is active.

DA> - replace checks of `gnus-registry-install' with checks of
DA> `gnus-registry-enabled'

DA> This also fixes the bug that with the default setting of
DA> `gnus-registry-install' (`ask'), the nnregistry server is stuck at
DA> `denied'.

TZ> This is very nice, thank you.  I'll commit it.  We're in a feature
TZ> freeze but I think it's more of a bug fix than a feature.

This is committed, thanks again and sorry for the delay.

Ted




Information forwarded to bugs <at> gnus.org:
bug#9691; Package gnus. (Mon, 17 Oct 2011 19:16:01 GMT) Full text and rfc822 format available.

Message #20 received at 9691 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Ted Zlatanov <tzz <at> lifelogs.com>
Cc: Dave Abrahams <dave <at> boostpro.com>, 9691 <at> debbugs.gnu.org
Subject: Re: bug#9691: Patch Enclosed (When `gnus-registry-install' is 'ask,
	nnregistry is broken)
Date: Mon, 17 Oct 2011 21:14:46 +0200
Ted Zlatanov <tzz <at> lifelogs.com> writes:

> This is committed, thanks again and sorry for the delay.

Has the FSF gotten Dave's copyright paperwork yet?  I haven't been
notified of that...

And the patch broke the XEmacs build.  Please fix.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to bugs <at> gnus.org:
bug#9691; Package gnus. (Mon, 17 Oct 2011 20:00:02 GMT) Full text and rfc822 format available.

Message #23 received at 9691 <at> debbugs.gnu.org (full text, mbox):

From: Ted Zlatanov <tzz <at> lifelogs.com>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: Dave Abrahams <dave <at> boostpro.com>, 9691 <at> debbugs.gnu.org
Subject: Re: bug#9691: Patch Enclosed (When `gnus-registry-install' is 'ask,
	nnregistry is broken)
Date: Mon, 17 Oct 2011 14:57:55 -0500
On Mon, 17 Oct 2011 21:14:46 +0200 Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote: 

LMI> Ted Zlatanov <tzz <at> lifelogs.com> writes:
>> This is committed, thanks again and sorry for the delay.

LMI> Has the FSF gotten Dave's copyright paperwork yet?  I haven't been
LMI> notified of that...

I thought they did.  Dave?  Do you mind if I rewrite your patch so we
don't require your papers, if they are not in yet?

LMI> And the patch broke the XEmacs build.  Please fix.

I will, pending Dave's response.

Ted




Information forwarded to bugs <at> gnus.org:
bug#9691; Package gnus. (Mon, 17 Oct 2011 22:39:02 GMT) Full text and rfc822 format available.

Message #26 received at 9691 <at> debbugs.gnu.org (full text, mbox):

From: Dave Abrahams <dave <at> boostpro.com>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: Ted Zlatanov <tzz <at> lifelogs.com>,
	"9691 <at> debbugs.gnu.org" <9691 <at> debbugs.gnu.org>
Subject: Re: bug#9691: Patch Enclosed (When `gnus-registry-install' is 'ask,
	nnregistry is broken)
Date: Mon, 17 Oct 2011 18:37:20 -0400
It went in the mail last week and I'm less than 2miles away...  Fwiw

BoostPro Computing * http://boostpro.com
[Sent from coveted but awkward mobile device]
--

On Oct 17, 2011, at 3:14 PM, Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote:

> Ted Zlatanov <tzz <at> lifelogs.com> writes:
> 
>> This is committed, thanks again and sorry for the delay.
> 
> Has the FSF gotten Dave's copyright paperwork yet?  I haven't been
> notified of that...
> 
> And the patch broke the XEmacs build.  Please fix.
> 
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>  bloggy blog http://lars.ingebrigtsen.no/




Information forwarded to bugs <at> gnus.org:
bug#9691; Package gnus. (Tue, 18 Oct 2011 11:36:01 GMT) Full text and rfc822 format available.

Message #29 received at 9691 <at> debbugs.gnu.org (full text, mbox):

From: Dave Abrahams <dave <at> boostpro.com>
To: Ted Zlatanov <tzz <at> lifelogs.com>
Cc: Lars Magne Ingebrigtsen <larsi <at> gnus.org>, 9691 <at> debbugs.gnu.org
Subject: Re: bug#9691: Patch Enclosed (When `gnus-registry-install' is 'ask,
	nnregistry is broken)
Date: Tue, 18 Oct 2011 07:34:01 -0400
on Mon Oct 17 2011, Ted Zlatanov <tzz-AT-lifelogs.com> wrote:

> On Mon, 17 Oct 2011 21:14:46 +0200 Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote: 
>
> LMI> Ted Zlatanov <tzz <at> lifelogs.com> writes:
>>> This is committed, thanks again and sorry for the delay.
>
> LMI> Has the FSF gotten Dave's copyright paperwork yet?  I haven't been
> LMI> notified of that...
>
> I thought they did.  Dave?  Do you mind if I rewrite your patch so we
> don't require your papers, if they are not in yet?

Rewrite anything you want, please.

> LMI> And the patch broke the XEmacs build.  Please fix.
>
> I will, pending Dave's response.

Broke the build!? Wow.  Ted, when you figure out why, please let me know.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




Added tag(s) fixed. Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 07 Jan 2012 01:11:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 24.1, send any further explanations to 9691 <at> debbugs.gnu.org and Dave Abrahams <dave <at> boostpro.com> Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 07 Jan 2012 01:11:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 04 Feb 2012 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 92 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.