unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Lars Ingebrigtsen <larsi@gnus.org>, 45330@debbugs.gnu.org
Subject: bug#45330: 28.0.50; debbugs-gnu: Can't select reports before having started Gnus
Date: Thu, 23 Dec 2021 14:42:04 -0800	[thread overview]
Message-ID: <87r1a3ymdf.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87tufezgk6.fsf@web.de> (Michael Heerdegen's message of "Sun, 12 Dec 2021 03:46:01 +0100")

[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]


On 12/12/21 03:46 AM, Michael Heerdegen wrote:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> I can switch the test to be something more explicit, but how about --
>
> Please let's not forget about this again.
>
> What has yet to be done to fix this issue?

Okay, dang it, here we go. Having thought about it, it seems like the
solutions might be simpler than I thought. `gnus-registry-initialize'
looks like this:

(defun gnus-registry-initialize ()
  "Initialize the Gnus registry."
  (interactive)
  (gnus-message 5 "Initializing the registry")
  (gnus-registry-install-hooks) => sets gnus-registry-enabled = t
  (gnus-registry-install-shortcuts)
  (if (gnus-alive-p)
      (gnus-registry-load)
    (add-hook 'gnus-read-newsrc-el-hook #'gnus-registry-load)))

It makes no sense to set `gnus-registry-enabled' to t when we haven't
fully loaded the registry. How about we move
`gnus-registry-install-hooks' and `gnus-registry-install-shortcuts' into
`gnus-registry-load', after the actual loading, a la the attached patch?
Does this solve the problems you're seeing?

Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnusregistryguard.diff --]
[-- Type: text/x-patch, Size: 907 bytes --]

diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el
index 163d543afd..feb39df925 100644
--- a/lisp/gnus/gnus-registry.el
+++ b/lisp/gnus/gnus-registry.el
@@ -356,7 +356,10 @@ gnus-registry-load
   (interactive)
   (let ((file gnus-registry-cache-file))
     (condition-case nil
-        (gnus-registry-read file)
+        (progn
+          (gnus-registry-read file)
+          (gnus-registry-install-hooks)
+          (gnus-registry-install-shortcuts))
       (file-error
        ;; Fix previous mis-naming of the registry file.
        (let ((old-file-name
@@ -1184,8 +1187,6 @@ gnus-registry-initialize
   "Initialize the Gnus registry."
   (interactive)
   (gnus-message 5 "Initializing the registry")
-  (gnus-registry-install-hooks)
-  (gnus-registry-install-shortcuts)
   (if (gnus-alive-p)
       (gnus-registry-load)
     (add-hook 'gnus-read-newsrc-el-hook #'gnus-registry-load)))

  reply	other threads:[~2021-12-23 22:42 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-20  4:53 bug#45330: 28.0.50; debbugs-gnu: Can't select reports before having started Gnus Michael Heerdegen
2020-12-21  4:56 ` Lars Ingebrigtsen
2020-12-21  7:10   ` Michael Heerdegen
2020-12-21 16:12     ` Eric Abrahamsen
2020-12-22 16:43       ` Eric Abrahamsen
2020-12-23  5:23         ` Michael Heerdegen
2020-12-23 18:08           ` Eric Abrahamsen
2021-12-04 23:18             ` Lars Ingebrigtsen
2021-12-05  0:23               ` Michael Heerdegen
2021-12-05 19:48                 ` Lars Ingebrigtsen
2021-12-05 22:18                   ` Eric Abrahamsen
2021-12-06  1:14                     ` Michael Heerdegen
2021-12-06  1:29                       ` Eric Abrahamsen
2021-12-06  5:46                     ` Lars Ingebrigtsen
2021-12-06 18:06                       ` Eric Abrahamsen
2021-12-06 21:29                         ` Michael Heerdegen
2021-12-06 21:45                           ` Eric Abrahamsen
2021-12-06 23:01                             ` Michael Heerdegen
2021-12-12  2:46                     ` Michael Heerdegen
2021-12-23 22:42                       ` Eric Abrahamsen [this message]
2021-12-31 18:55                         ` Michael Heerdegen
2021-12-31 20:43                           ` Eric Abrahamsen
2022-01-12 23:06                           ` Eric Abrahamsen
2022-01-12 23:07                           ` Eric Abrahamsen
2022-01-13 12:43                             ` Michael Heerdegen
2022-01-13 19:42                               ` Eric Abrahamsen
2022-01-13 21:54                                 ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1a3ymdf.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=45330@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).