From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Tassilo Horn <tsdh@gnu.org>
Cc: ding@gnus.org
Subject: Re: nnir-summary-line-format doesn't work
Date: Sun, 07 Jun 2020 08:36:05 -0700 [thread overview]
Message-ID: <87eeqqriqi.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87v9k39u9a.fsf@gnu.org> (Tassilo Horn's message of "Sun, 07 Jun 2020 10:04:33 +0200")
Tassilo Horn <tsdh@gnu.org> writes:
> 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:
>
> 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)
>
> 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
Patch looks good to me, and I see it's in. Hope Eli doesn't bite you for
making Emacs 27 changes at this late hour... :)
prev parent reply other threads:[~2020-06-07 15:37 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
2020-06-07 15:36 ` Eric Abrahamsen [this message]
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=87eeqqriqi.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=ding@gnus.org \
--cc=tsdh@gnu.org \
/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).