Gnus development mailing list
 help / color / mirror / Atom feed
* nnir-summary-line-format doesn't work
@ 2020-06-06  9:21 Tassilo Horn
  2020-06-06 20:10 ` Eric Abrahamsen
  0 siblings, 1 reply; 4+ messages in thread
From: Tassilo Horn @ 2020-06-06  9:21 UTC (permalink / raw)
  To: ding

Hi all,

it seems like `nnir-summary-line-format' doesn't work in the current
Emacs master (and probably hasn't worked for ages).  It gets set as
`gnus-summary-line-format' in `nnir-mode' which is called in
`gnus-summary-prepared-hook'.  However, at that point, the summary
buffer is already built using the original `gnus-summary-line-format'
value.

The patch below fixes this problem.  Could someone with a bit more Gnus
knowledge have a look at it and tell me if IDRT?

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

modified   lisp/gnus/nnir.el
@@ -663,6 +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-generate-hook 'nnir-summary-generate-setup)
       (add-hook 'gnus-summary-prepared-hook 'nnir-mode)
       (nnoo-change-server 'nnir server definitions))))
 
@@ -1848,10 +1849,14 @@ nnir-registry-action
    to
    method))
 
+(defun nnir-summary-generate-setup ()
+  (when (and (eq (car (gnus-find-method-for-group gnus-newsgroup-name)) 'nnir)
+             nnir-summary-line-format)
+    (setq gnus-summary-line-format nnir-summary-line-format)
+    (gnus-update-format-specifications nil 'summary)))
+
 (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 (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---

Bye,
Tassilo


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-06-07 15:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-06  9:21 nnir-summary-line-format doesn't work Tassilo Horn
2020-06-06 20:10 ` Eric Abrahamsen
2020-06-07  8:04   ` Tassilo Horn
2020-06-07 15:36     ` Eric Abrahamsen

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).