From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.bugs Subject: bug#54423: 29.0.50; gnus-fetch-original-field returns nil in digest Date: Mon, 21 Mar 2022 20:04:53 -0400 Message-ID: References: <87ee30vo80.fsf@gnus.org> <87cziku6kv.fsf@gnus.org> <87k0cssiaw.fsf@gnus.org> Reply-To: sds@gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13076"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: bbdb-user@nongnu.org, 54423@debbugs.gnu.org, ding@gnus.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 22 01:12:39 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nWS8c-0003Cq-O3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Mar 2022 01:12:38 +0100 Original-Received: from localhost ([::1]:55862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWS8b-0001nJ-Kj for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Mar 2022 20:12:37 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWS2F-0000MC-Ha for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 20:06:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44881) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWS2D-0007gW-VW for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2022 20:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nWS2D-0005Mp-ML; Mon, 21 Mar 2022 20:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sam Steingold Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Tue, 22 Mar 2022 00:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54423 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: notabug Original-Received: via spool by 54423-submit@debbugs.gnu.org id=B54423.164790751320569 (code B ref 54423); Tue, 22 Mar 2022 00:06:01 +0000 Original-Received: (at 54423) by debbugs.gnu.org; 22 Mar 2022 00:05:13 +0000 Original-Received: from localhost ([127.0.0.1]:38777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWS1K-0005LY-Rx for submit@debbugs.gnu.org; Mon, 21 Mar 2022 20:05:13 -0400 Original-Received: from mail-qk1-f181.google.com ([209.85.222.181]:46072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nWS1E-0005Kr-Fz for 54423@debbugs.gnu.org; Mon, 21 Mar 2022 20:05:05 -0400 Original-Received: by mail-qk1-f181.google.com with SMTP id h196so12887200qke.12 for <54423@debbugs.gnu.org>; Mon, 21 Mar 2022 17:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:in-reply-to:references:user-agent :return-receipt-to:reply-to:mail-followup-to:date:message-id :mime-version:content-transfer-encoding; bh=6oAOI0j3DPwmu9kFVYEiemHs6PmVuflOMTmfUnrZEoY=; b=V7Rr514HvdG/0KNcwe4DGe9OnS4EtCmb1ojyfxScexo7sm1KXtZ4SEc+RcIGRIBJbU gwFyEVcCaL7goLHyCjWHOgAaz57puK83HrxRQ6XumLAol+8SJ+GFiFHAO5WB0W1ZYgYY BRcI7u9Dh7oqTXVms2d5NDXRH5cEi6pJBWII51OWOda0bsmZJMPsJKYbjFXhA389bt67 U9OGMfARtJIqG6GoEOeM6xy3nxIwzBlfbom232dCmtWwBwdUtEcBN4GI/ejbNPmvYHrL iMmFnsRszTAc8b4KMf0+MOCx/C3rwnfj6L8dKYdn6BRenHazX1KlQFd5H8k8Pjq8fXN0 dwcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:return-receipt-to:reply-to:mail-followup-to:date :message-id:mime-version:content-transfer-encoding; bh=6oAOI0j3DPwmu9kFVYEiemHs6PmVuflOMTmfUnrZEoY=; b=wWWsF6AknrC3lVBBIHDTbmU9Qi5mhSKKqwimeDIOlF9UTVFubO7nqIVBD/kLDcmlSP oCKVZwRC79FiIPIj8gfuVbUSY4+2Fe0raGTUlcmxK0CsNFL6HRX3xsWsYuVMLu/mYbfl OMHY6xd/sM2h2n57LmYApGrUcEupSCwzk0FP1YUgi7Hk0cDWRrUIGs8Z9Bf2uv9tI77J X5YdbstTNloZkc58It+ze71DQq078+tnp0iEvzYR0XAfwCjSBinn1Tcg8fqNZ18HaF9D Bn3jKjE99Ne6i+HLOrJCZaRdO/KV2dHFQoYZFycW0G8EtE8s7Z8MxvWyZAdXsVT1cYKn yeJA== X-Gm-Message-State: AOAM530R63FeTfZSwLGSDFQZBd+ojxxsBccG83cx03CYm8LzsuK2K3Wi odT/AHxMOuGd97SD5rLIdQ== X-Google-Smtp-Source: ABdhPJwxZW6eoEB/8sWnEc1EvtVqbt4jsOd2mujPrlOLwhveWat3ukdhRQkd8I38c48eoidv4BDCdA== X-Received: by 2002:a37:2e42:0:b0:67e:6d80:2707 with SMTP id u63-20020a372e42000000b0067e6d802707mr8462884qkh.365.1647907494786; Mon, 21 Mar 2022 17:04:54 -0700 (PDT) Original-Received: from 3c22fb11fdab.ant.amazon.com (pool-108-30-23-113.nycmny.fios.verizon.net. [108.30.23.113]) by smtp.gmail.com with ESMTPSA id v12-20020a05622a130c00b002e1b3ccd9adsm13282361qtk.79.2022.03.21.17.04.54 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Mar 2022 17:04:54 -0700 (PDT) In-Reply-To: <87k0cssiaw.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 17 Mar 2022 16:35:51 +0100") X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Mail-Followup-To: Lars Ingebrigtsen , 54423@debbugs.gnu.org, ding@gnus.org, bbdb-user@nongnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228732 Archived-At: Context (see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D54423): `bbdb-message-header' calls `gnus-fetch-original-field' which, for a digest ("nndoc") group, returns nil for every header. The root of the problem is that `gnus-fetch-original-field' relies on `gnus-original-article-buffer' which is buffer-local: --8<---------------cut here---------------start------------->8--- gnus-original-article-buffer is a variable defined in =E2=80=98gnus.el=E2= =80=99. Its value is " *Original Article nndoc:gmane.comp.security.risks-1023*" Local in buffer *Summary nndoc:gmane.comp.security.risks-1023*; global valu= e is the same. --8<---------------cut here---------------end--------------->8--- (buffer " *Original Article nndoc:gmane.comp.security.risks-1023*" is _empt= y_!) and at the _same_ time (no gnus command executed, just a buffer switch): --8<---------------cut here---------------start------------->8--- gnus-original-article-buffer is a variable defined in =E2=80=98gnus.el=E2= =80=99. Its value is " *Original Article gmane.comp.security.risks*" Local in buffer *Summary gmane.comp.security.risks*; global value is the sa= me. --8<---------------cut here---------------end--------------->8--- Lars suggested that I use this: --8<---------------cut here---------------start------------->8--- (gnus-info-params (gnus-get-info gnus-newsgroup-name)) --8<---------------cut here---------------end--------------->8--- and it appears that the following works: --8<---------------cut here---------------start------------->8--- diff --git a/lisp/bbdb-mua.el b/lisp/bbdb-mua.el index f9d141d..ab3863c 100644 --- a/lisp/bbdb-mua.el +++ b/lisp/bbdb-mua.el @@ -111,7 +111,17 @@ MIME encoded headers are decoded. Return nil if HEADE= R does not exist." ;; `bbdb-select-message' does not get fooled by an ap= parent ;; absence of some headers. ;; See http://permalink.gmane.org/gmane.emacs.gnus.ge= neral/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=3D54423 + ;; 'gnus-fetch-original-field' returns nil in nnd= oc groups + ;; (digests) because the 'qgnus-original-article-= buffer' is + ;; empty for the nndoc summary but not for the pa= rent summary. + (and-let* ((i (gnus-get-info gnus-newsgroup-name)) + (p (gnus-info-params i)) + (parent-summary-buffer (cadr (assq 'qu= it-config p)))) + (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--- `quit-config' contains the parent summary buffer object. I would rather use that directly that construct the string " *Original Article gmane.comp.security.risks*" (especially since the relevant logic in `gnus-article-setup-buffer' is moderately convoluted). The question is whether this is TRT or there is a better way. Thanks to Lars for his patience, and to everyone else for possible suggestion. --=20 Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.2113 http://childpsy.net http://calmchildstories.com http://steingoldpsychology.= com https://honestreporting.com https://camera.org http://think-israel.org Money does not bother me at all. In fact, it calms me down.