From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4KGINpESkGJh9gAAbAwnHQ (envelope-from ) for ; Fri, 27 May 2022 01:51:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wPmcNZESkGJbtgAAG6o9tA (envelope-from ) for ; Fri, 27 May 2022 01:51:45 +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 1782446295 for ; Fri, 27 May 2022 01:51:44 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id AE51F5F78D; Thu, 26 May 2022 23:51:41 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id B73485F782 for ; Thu, 26 May 2022 23:51:38 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 0C42E5FBD7; Thu, 26 May 2022 19:51:38 -0400 (EDT) Received: (nullmailer pid 676571 invoked by uid 1000); Thu, 26 May 2022 23:51:36 -0000 From: David Bremner To: jao , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: notmuch-show-header-line: allow format strings and functions In-Reply-To: <20220518192956.1440103-2-jao@gnu.org> References: <20220518192956.1440103-1-jao@gnu.org> <20220518192956.1440103-2-jao@gnu.org> Date: Thu, 26 May 2022 20:51:36 -0300 Message-ID: <87zgj34zuf.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: MC7LHW772OPZTKG3F5MAHB3GPTG5CJSC X-Message-ID-Hash: MC7LHW772OPZTKG3F5MAHB3GPTG5CJSC 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-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653609105; 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=PxySzBzHKzZ2BYvxWC5KZgIxzDl7/PGYR5Xyot5oIKs=; b=QefjI4NGL57xIb2LfPs/GvJi9eWoGexfXxQWM8s12629jeVzwGpNZUsQnfIya6dYUe3NMB 7FgZchXx9VZYlgNJF220f9YIAKKSk6a8FhCkGJ3SYFc3JHd5INqjHTFgFfjYqHlx/XHCGK 8Vv1eAyhHzu7JUGCjGBnyuQSxqHn5/ltRGFq3m1erYd93BDBZvn4yYVF37To4e80Voktbt d2UlZc7BcryNDcewuaN4Y4wZF1BujCRIqUu7Q5vUAxNWax4mtKKWm6LQSCzy3iyV4Zaphu vWtY5rd6EgNZp/GmYjMMLVPW3KQ07JLNcWE2ZJas+MAAoDhpzHnTwuby0RlsgQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653609105; a=rsa-sha256; cv=none; b=ccJDycwfcUGd03nMwebwl+RlhTk3n8/fVHEO58MLtVIxnRLFg9W5by5XhbF2OEb9fZqpfN 26YtMPFImIE2fNwpZAo3FqlZNsAVA1wWVAsq2ZN2eqrehhD56EdGmCL8x702GMVEEP1oyL tAGP5rt14iIhKR2P0xMzW2l3gCi8j8uTwO4zsSvklUbHv9pIRTNeWjHagHDyt7X259wpQ9 2cB53QqrEa6wl5VROr5MYSvvZ4SeFoIUi6TFsbW3apD4QavsxMCmoiISpOnrSKnY4wlZka Rz1oFIrB6jD+fOdFMfrBgxaxvryRG7XNsJ43rmepZTx6R6DG8Jwui+9+slXg8Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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 X-Migadu-Spam-Score: -2.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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 X-Migadu-Queue-Id: 1782446295 X-Spam-Score: -2.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: U0uRQCArZk1J jao writes: > If a string value is assigned to notmuch-show-header-line, it's used > as a format string to be passed passed to format-spec with `%s` > substituted by the message's subject. If a function is given, it's > called with the subject as argument, and its return value used as > header line. The API defined here (function taking the subject as a string) seems a bit limited. What if the user wants to use some other message header in the header-line? Or list tags? I would complain about missing test, but I think the test machinery works via buffer-substring-no-properties, which excludes header and mode lines. On the other hand, it should be possible to update the manual, at least with a copy of the docstring.