bbdb-user
[Top][All Lists]
Advanced

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

Re: bug#54423: 29.0.50; gnus-fetch-original-field returns nil in digest


From: Sam Steingold
Subject: Re: bug#54423: 29.0.50; gnus-fetch-original-field returns nil in digest
Date: Tue, 22 Mar 2022 13:08:57 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin)

> * Roland Winkler <jvaxyre@tah.bet> [2022-03-22 11:49:14 -0500]:
>
> On Mon, Mar 21 2022, Sam Steingold wrote:
>> Lars suggested that I use this:
>>
>> (gnus-info-params (gnus-get-info gnus-newsgroup-name))
>>
>> and it appears that the following works:
>>
> [snip]
>> +          (and-let* ((i (gnus-get-info gnus-newsgroup-name))
>> +                     (p (gnus-info-params i))
>> +                     (parent-summary-buffer (cadr (assq 'quit-config p))))
>> +            (with-current-buffer parent-summary-buffer
>> +              (gnus-fetch-original-field header)))))
>
> ...Is the (and-let*... needed?  Of course, one could wrap all code that
> way.  But and-let* is not even part of Emacs 25 that current BBDB is
> supposed to support.  Also, if the above code should fail in certain
> cases, it might be an indication that the above code is not yet exactly
> what is needed so that this should not be swept under the carpet.  So I
> feel that
>  
>   (with-current-buffer (cadr (assq 'quit-config
>                                    (gnus-info-params
>                                     (gnus-get-info gnus-newsgroup-name))))
>
> is the better way to go.  Am I missing something?

yes, when the current group is _not_ `nndoc`, there is no `quit-config'
and `with-current-buffer' will signal an "nil is not a buffer" error.

if you want to keep backwards compatibility, you can use this instead:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/bbdb-mua.el b/lisp/bbdb-mua.el
index f9d141d..36e64f4 100644
--- a/lisp/bbdb-mua.el
+++ b/lisp/bbdb-mua.el
@@ -111,7 +111,19 @@ MIME encoded headers are decoded.  Return nil if HEADER 
does not exist."
                      ;; `bbdb-select-message' does not get fooled by an 
apparent
                      ;; absence of some headers.
                      ;; See 
http://permalink.gmane.org/gmane.emacs.gnus.general/78741
-                     (eq mua 'gnus) (gnus-fetch-original-field header))
+                     (eq mua 'gnus)
+                     (or (gnus-fetch-original-field header)
+                         ;; See 
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54423
+                         ;; 'gnus-fetch-original-field' returns nil in nndoc 
groups
+                         ;; (digests) because the 
'gnus-original-article-buffer' is
+                         ;; empty for the nndoc summary but not for the parent 
summary.
+                         (let ((parent-summary-buffer
+                                (cadr (assq 'quit-config
+                                            (gnus-info-params
+                                             (gnus-get-info 
gnus-newsgroup-name))))))
+                           (and parent-summary-buffer
+                                (with-current-buffer parent-summary-buffer
+                                  (gnus-fetch-original-field header))))))
                     ((eq mua 'vm) (bbdb/vm-header header))
                     ((eq mua 'rmail)
                      (with-current-buffer rmail-buffer
--8<---------------cut here---------------end--------------->8---



-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.2113
http://childpsy.net http://calmchildstories.com http://steingoldpsychology.com
https://memri.org https://iris.org.il https://honestreporting.com
XFM: Exit file manager? [Continue] [Cancel] [Abort]




reply via email to

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