From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id S3nyFKBrDWXulQAAauVa8A:P1 (envelope-from ) for ; Fri, 22 Sep 2023 12:25:36 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id S3nyFKBrDWXulQAAauVa8A (envelope-from ) for ; Fri, 22 Sep 2023 12:25:36 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B3AD863340 for ; Fri, 22 Sep 2023 12:25:35 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695378336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=2NvNW5sr7DX6Xz22wfYde9JhZTG8IhumpFFq8k/Zc6k=; b=geoM20BDEf2ycUR/aiRfYSdAoMPYs5Y/MRakvSHhr0BrGH5VbetRI6hZOkx/q2OgxQCAaH lDLLOA8y6I1/WYcTylVpZIgMH93oHZeMFosLZ5b8ApEs+drykvM09p41TcXNQXY43LSNy8 KJ1RT+q1Q+NHDX65SxNE+dvKlNqB7puOSIIOHc6G1jmdR4+sJx2gFXwwMcgYelJOlTJD1R sw4fGJa0dfDBIepDgNTEwDfWqFIApkbHy5hG6+1tF9WAfRuu6QD8bbijzZ7NGjV3JEyHtI GF2q3YGDFpXAGs40Csq8OBN3YuV4tAizcInKccyxWhb5K/fGPAE45RbfqS0mlQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695378336; a=rsa-sha256; cv=none; b=HCJ83+2ypkSGOAu4E8PJxbfY+5P6b85c/HzYJy0v8GpdgcXYwQRcUdmilbLAeOHvnDkceQ X8Y2Da2v94OMv7CsLt2FwzP02Uxq+w9LGCKNBFVERVKFWzjDeGO9mT21SaKGTmk1vE5leo ttOOcRdsTKF9eTZccYCuMrjngt3oAAjA248GVU4/e0ThKedm3RCfR1FtvuR0tkj9QHh/EK phA8nQVkd9+YYjL4o2vGxpQCoWqWboQ+yFAAPqnX4P/95ToPPT5VIRWQWr3hHHFifx37FM cnYGFFNkNlD2W0jUMZeUwhKDkp+R5Figmbe0oEPLOnnIUU5rz5Du+zZuGM4OHA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=none Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id EBBF060A2F; Fri, 22 Sep 2023 10:25:32 +0000 (UTC) Received: from phubs.tethera.net (phubs.tethera.net [IPv6:2607:5300:60:3a9d::1]) by mail.notmuchmail.org (Postfix) with ESMTPS id 9516D60983 for ; Fri, 22 Sep 2023 10:25:30 +0000 (UTC) Received: from tethera.net (fctnnbsc51w-159-2-210-253.dhcp-dynamic.fibreop.nb.bellaliant.net [159.2.210.253]) by phubs.tethera.net (Postfix) with ESMTPS id B9525180066; Fri, 22 Sep 2023 07:25:28 -0300 (ADT) Received: (nullmailer pid 854080 invoked by uid 1000); Fri, 22 Sep 2023 10:25:27 -0000 From: David Bremner To: David Pinto , notmuch@notmuchmail.org Subject: Re: automatically changing FCC when From changes (or fill FCC only when sending) In-Reply-To: References: <87bke2ozy8.fsf@tethera.net> Date: Fri, 22 Sep 2023 07:25:27 -0300 Message-ID: <874jjm33oo.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: UIS5KAZ6I6TIGJM6CKBDFX4D6EONY3MN X-Message-ID-Hash: UIS5KAZ6I6TIGJM6CKBDFX4D6EONY3MN X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -0.94 X-Spam-Score: -0.94 X-Migadu-Queue-Id: B3AD863340 X-TUID: 6r60IaX4020P David Pinto writes: > > I see what you mean, how changing the FCC would prevent the ability to > manually edit the FCC. But what about updating the FCC when the > "From" changes? I don't know how to efficiently detect changes to From. (notmuch-)message-mode is essentially a text editor buffer, including the header area, so I think one would have to reparse the buffer after every keystroke. I think that would be annoyingly slow, but I haven't tried it. The hook is called "post-command-hook" if you are feeling adventurous, but see the warnings in the docstring. > You mention updating the "From" when the "To" changes with the > notmuch-address-post-completion-functions hook. Could there be a hook > for when the "From" changes which I could use to change the FCC? My partial-solution relies on using completion to change To. If you are OK with that (i.e. manual editing without completion would not update Fcc), then the same scheme could work. Another option that seems technically feasible, but would involve some elisp programming, would be to write a command that re-applies the calculation of Fcc from From that already exists, and run that manually or perhaps opt-in to running it automatically on send.