[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 1af0e95: Gnus nnir-summary-line-format has no effect

From: Tassilo Horn
Subject: emacs-27 1af0e95: Gnus nnir-summary-line-format has no effect
Date: Sun, 7 Jun 2020 04:04:15 -0400 (EDT)

branch: emacs-27
commit 1af0e95fec0d9c63b92ea081d6ca15ecd82d1ade
Author: Tassilo Horn <tsdh@gnu.org>
Commit: Tassilo Horn <tsdh@gnu.org>

    Gnus nnir-summary-line-format has no effect
    * lisp/gnus/nnir.el (nnir-mode): Update summary format specs if
    nnir-summary-line-format is set and different from
    (nnir-open-server): Run nnir-mode in gnus-summary-generate-hook
    instead of gnus-summary-prepared-hook.
 lisp/gnus/nnir.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index 823bc2b..f1e31a0 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -662,7 +662,7 @@ A non-nil `specs' arg must be an alist with 
`nnir-query-spec' and
   (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)
@@ -1849,8 +1849,11 @@ is also searched."
 (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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]