From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10063 invoked from network); 18 Mar 2021 15:38:09 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 18 Mar 2021 15:38:09 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lMuis-001obc-77 for ml@inbox.vuxu.org; Thu, 18 Mar 2021 10:38:06 -0500 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1lMuir-001s79-Jn for ml@inbox.vuxu.org; Thu, 18 Mar 2021 10:38:05 -0500 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lMuip-001s6u-FW for ding@lists.math.uh.edu; Thu, 18 Mar 2021 10:38:03 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lMuin-001vkI-LW for ding@lists.math.uh.edu; Thu, 18 Mar 2021 10:38:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Pi0R5ovjKbBZoI0/NiStDQbOGnzv0TpIptlZJIvmVGA=; b=je6PpaLCVht3a4seaW2n86UEqX XDNOHCBBSCFGNm3NUEq75TPPlIMw7rc70rcyRjowJ8wjyIuqpRE+u2L4+m0EXCL5EA5Gx0kZpUy4Y J2ux28CY3SCzMCtgOqEFrr6b3hCVZdztUpIjFnamDtcCz6yH2OXcEs5HaCYz9QpPHpNI=; Received: from ericabrahamsen.net ([52.70.2.18] helo=mail.ericabrahamsen.net) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMuig-0006Nz-Ds for ding@gnus.org; Thu, 18 Mar 2021 16:37:56 +0100 Received: from localhost (c-73-254-86-141.hsd1.wa.comcast.net [73.254.86.141]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id C2EF2FA0E3 for ; Thu, 18 Mar 2021 15:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1616081872; bh=Pi0R5ovjKbBZoI0/NiStDQbOGnzv0TpIptlZJIvmVGA=; h=From:To:Subject:References:Date:In-Reply-To:From; b=O5qJmBaVAXTr4LCB+Pz92BxQgyzyd7Op7Am6wNfxBxShpStqronKKKf8yDg2bzpHV t5R8IN07mFyWrLX4qM1yBobvOOnBspfvghtK60EYHKY8h/R+pd2JbWNvceTkilRn3c s9/9fWPbeMYDLCmwN6Uaw+udfv4BBWngie+EFawo= From: Eric Abrahamsen To: ding@gnus.org Subject: Re: [if cc is empty?] References: <87v99wfbmq.fsf@mat.ucm.es> <87zgz8tckb.fsf@ericabrahamsen.net> <87a6r5h1fx.fsf_-_@mat.ucm.es> <87czw02e9l.fsf@ericabrahamsen.net> <87tupbgwvy.fsf@mat.ucm.es> <87y2enrovi.fsf@ericabrahamsen.net> <87a6r0fyjj.fsf_-_@mat.ucm.es> Date: Thu, 18 Mar 2021 08:37:50 -0700 In-Reply-To: <87a6r0fyjj.fsf_-_@mat.ucm.es> (Uwe Brauer's message of "Thu, 18 Mar 2021 13:15:28 +0100") Message-ID: <87ft0slbg1.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain List-ID: Precedence: bulk Uwe Brauer writes: >> Uwe Brauer writes: > >> Looks like the %(expr) escapes are evaluated in the *Capture* buffer, >> not the buffer where you started the capture. You might have to do: > >> (defun my-extract-cc () >> (interactive) >> (with-current-buffer (org-capture-get :original-buffer) >> (mail-decode-encoded-address-string >> (gnus-fetch-original-field "cc")))) > > I just realized that I might use that template, even for messages with > empty CC fields, however in that case my template will fail. > > How can I add something like > > (if cc-non-empty > (with-current-buffer (org-capture-get :original-buffer) > (mail-decode-encoded-address-string > (gnus-fetch-original-field "cc")))) > > thanks You'll just have to let-bind the cc field and then check it. (Or `when-let', if your Emacs has that.) You can put this inside the `with-current-buffer': (let ((cc (gnus-fetch-original-field "cc"))) (if cc (mail-decode-encoded-address-string cc) ""))