Subject: Re: bug#9691: Acknowledgement (When `gnus-registry-install' is 'ask, nnregistry is broken)

From: Dave Abrahams <[email-masked]>
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.