emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/gnorb d2831b8 237/449: Refactor summary buffer hinting


From: Stefan Monnier
Subject: [elpa] externals/gnorb d2831b8 237/449: Refactor summary buffer hinting into separate function
Date: Fri, 27 Nov 2020 23:15:46 -0500 (EST)

branch: externals/gnorb
commit d2831b8073a8af23df55e2abee522d43b472b0ec
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Refactor summary buffer hinting into separate function
    
    * gnorb-gnus.el (gnorb-gnus-insert-format-letter-maybe): New function.
    
    Easier to debug than the previous (fset (intern... thing.
---
 gnorb-gnus.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index 7757b16..19db49d 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -617,10 +617,8 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
 
 (add-hook 'gnus-article-prepare-hook 'gnorb-gnus-hint-relevant-message)
 
-(fset (intern (concat "gnus-user-format-function-"
-                     gnorb-gnus-summary-mark-format-letter))
-      (lambda (header)
-       (if (and gnorb-tracking-enabled
+(defun gnorb-gnus-insert-format-letter-maybe (header)
+  (if (and gnorb-tracking-enabled
                 (not (memq (car (gnus-find-method-for-group
                                  gnus-newsgroup-name))
                            '(nnvirtual nnir))))
@@ -631,7 +629,12 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
                           (gnorb-find-visit-candidates ref-ids)))
                  gnorb-gnus-summary-mark
                " "))
-         " ")))
+         " "))
+
+(fset (intern (concat "gnus-user-format-function-"
+                     gnorb-gnus-summary-mark-format-letter))
+      (lambda (header)
+       (gnorb-gnus-insert-format-letter-maybe header)))
 
 ;;;###autoload
 (defun gnorb-gnus-view ()



reply via email to

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