Gnus development mailing list
 help / color / mirror / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: ding@gnus.org
Subject: Re: nnir-summary-line-format doesn't work
Date: Sun, 07 Jun 2020 10:04:33 +0200	[thread overview]
Message-ID: <87v9k39u9a.fsf@gnu.org> (raw)
In-Reply-To: <87mu5grm4n.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 06 Jun 2020 13:10:32 -0700")

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

Hi Eric,

>> The patch below fixes this problem.  Could someone with a bit more
>> Gnus knowledge have a look at it and tell me if IDRT?
>
> I would expect that you can just move all of `nnir-mode' to
> `gnus-summary-generate-hook'. The only other thing `nnir-mode' does is
> mess with the article-(delete|move|expire)-hook, and those hooks have
> all had their local values set by this stage.
>
> It would be a simpler solution, anyway -- try it out and see if
> anything goes wrong?

Seems to work.  So I would like to push this change:

--8<---------------cut here---------------start------------->8---
1 file changed, 6 insertions(+), 3 deletions(-)
lisp/gnus/nnir.el | 9 ++++++---

modified   lisp/gnus/nnir.el
@@ -663,7 +663,7 @@ nnir-open-server
   (let ((backend (car (gnus-server-to-method server))))
     (if backend
 	(nnoo-change-server backend server definitions)
-      (add-hook 'gnus-summary-prepared-hook 'nnir-mode)
+      (add-hook 'gnus-summary-generate-hook 'nnir-mode)
       (nnoo-change-server 'nnir server definitions))))
 
 (deffoo nnir-request-group (group &optional server dont-check _info)
@@ -1850,8 +1850,11 @@ nnir-registry-action
 
 (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 nnir-summary-line-format
+               (not (string= nnir-summary-line-format
+                             gnus-summary-line-format)))
+      (setq gnus-summary-line-format nnir-summary-line-format)
+      (gnus-update-format-specifications nil 'summary))
     (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)
--8<---------------cut here---------------end--------------->8---

The `gnus-update-format-specifications' seems to be needed anyway when a
different summary line should be shown in nnir summaries.

I'd like to push to emacs-27 (given that the nnir code is almost the
same there), although I couldn't test it there because of an error.
When I do a nnir search there which has any matches, I get to an infloop
where Emacs blinks and repeatedly shows

  No more unread articles

in the echo area.  Even C-g doesn't break out of that loop.

Hm, now I've tried with emacs -Q (emacs-27 with my normal ~/.gnus.el),
and then the error doesn't happen but I can reproduce the
`nnir-summary-line-format' problem and verify the fix.  So I'll push it.

Thanks,
Tassilo


  reply	other threads:[~2020-06-07  8:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06  9:21 Tassilo Horn
2020-06-06 20:10 ` Eric Abrahamsen
2020-06-07  8:04   ` Tassilo Horn [this message]
2020-06-07 15:36     ` Eric Abrahamsen

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

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

  git send-email \
    --in-reply-to=87v9k39u9a.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=ding@gnus.org \
    --cc=eric@ericabrahamsen.net \
    /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.
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).