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 ms0.migadu.com with LMTPS id oL8iLSer4GEcTwEAgWs5BA (envelope-from ) for ; Thu, 13 Jan 2022 23:43:51 +0100 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 cOXKJSer4GHXDgAAG6o9tA (envelope-from ) for ; Thu, 13 Jan 2022 23:43:51 +0100 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 37A7B33C64 for ; Thu, 13 Jan 2022 23:43:51 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 155155F720; Thu, 13 Jan 2022 22:43:47 +0000 (UTC) Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by mail.notmuchmail.org (Postfix) with ESMTPS id 41B565F70A for ; Thu, 13 Jan 2022 22:43:44 +0000 (UTC) Received: from [2001:470:142:3::e] (port=55748 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n88on-00083P-5o; Thu, 13 Jan 2022 17:43:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=+TMfu9MmGkuTyIaV8xSiuFQ08ZAkFM36AEQ/NUWkFvg=; b=CAdyd/Sc3HSZdI8NqOWw tgndV3WSLkzTu7WHmtBbaolKD9uObTAyoNTOToo58WlRKaxoia3HH9W1awpO6I0oioPeHHNMwczns XsrpaNOC+57WxYzoOjxhMH7kVtNLe0go7pft/2ERdYpElCVs+RqscCmhfYeLMEf1dXl9NfjCMza5f oH54eKIeDjSJpQk2pZPAGfx2SZHBw+MI/MUNY/ZqN1/KAB47XCRzwbFFwJM4O2JuLJaqavmMCWETk UwRE2mISkC4Mo/JhYteJ/YVPbfpE4f3EudpLpYfTFDfSKJh7yamQlbH4ToNpOS0SwPSHTBz+RihQC /sRhj3eoyMNkxQ==; Received: from 84.red-176-83-203.dynamicip.rima-tde.net ([176.83.203.84]:47991 helo=rivendell.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n88on-0002cN-3Y; Thu, 13 Jan 2022 17:43:41 -0500 Received: from localhost (rivendell.localdomain [local]) by rivendell.localdomain (OpenSMTPD) with ESMTPA id 999b950f; Thu, 13 Jan 2022 22:43:36 +0000 (UTC) From: Jose A Ortega Ruiz To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH v4] emacs: customizable names for search buffers In-Reply-To: References: <20220110181644.1457631-1-jao@gnu.org> X-Attribution: jao X-Clacks-Overhead: GNU Terry Pratchett X-URL: Date: Thu, 13 Jan 2022 22:43:36 +0000 Message-ID: <87h7a7uuhz.fsf@gnus.jao.io> MIME-Version: 1.0 Message-ID-Hash: INC24HX7OEGKHOGSXEMXIWAR2WAV4MTA X-Message-ID-Hash: INC24HX7OEGKHOGSXEMXIWAR2WAV4MTA X-MailFrom: jao@gnu.org 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642113831; 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:dkim-signature; bh=UaunyV2WoRmwDMJOJGBBKvtjykRvACFsMpMdIPHNOsg=; b=TXHQDZqWAwcRBTddRQKkmGKrRTcDyCxRHcnSx5ZEiXDPt1UYBMzFX/CrxtUuqK7mSELRFj dWjuNke756IPKRgp7fCxdReEkXxvL7itW0s52tGu/sIvuODe2r0PPx8Ap5fn39r0gKErf+ kImgoSm32x1/bv1NwB8Bp5xJUPo0OEOhZPZq6GPg2RGrzrWwFKPScokhU0UhNMPsjl35Z4 njH/8CNiQbLuF/aqEVCxh3rhnqTTJHtpqx3gTIAdcs3L+qZg0quRum9S6mCkiDjBgkXU/G LV+P97MZ2wdTjg1QaMGEFSQG2xKhM0PWH+2+RRo+n9CLz+aUWsNmYY+nAJ1Axw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642113831; a=rsa-sha256; cv=none; b=rWwpBYFPOSZnV3GWwmWC+63mkv3773boUVtgLBiGqD+15Ulp0iZaYMPirGGKeT8I8eZHTI DZ4RU59tSAzDOF9LxcKnI1baBvhWjLvf2MBglN8yON1GzX6kiQXPPv1O2lL3Ll9gbSoSke 9h7DmOCDVD9VC3/IwBrBxazxaGeYWWg/fQi0VfXmbijrIIoRIwQ2txLPOJVu1fQX7pa+EL oKvMcpGQHTgZP+sjmtdqiu5/NOTn42XEvpoU48DnzGpmmnMUHLKH7uecun973cJcU0rkE6 uY+6JrUMCChvRry5HZRemo3uvVYDBrP12L5NKsdlr1Gdww9wCHumAENZAYXmXg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b="CAdyd/Sc"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gnu.org (policy=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: -1.64 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b="CAdyd/Sc"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gnu.org (policy=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: 37A7B33C64 X-Spam-Score: -1.64 X-Migadu-Scanner: scn1.migadu.com X-TUID: O5xXlzX7lRW6 On Thu, Jan 13 2022, Tomi Ollila wrote: [...] > I am curious about this regexp, \b is matching word/non-word boundary -- so > I had to test it. > > (replace-regexp-in-string "\\b%t\\b" "repl" "foo %t bar") ;; no replacement > (replace-regexp-in-string "\\b%t\\b" "repl" "foo-%t-bar") ;; no replacement > ... > (replace-regexp-in-string "\\b%t\\b" "repl" "foox%t-bar") ;; replacement! > > before % there is "word" character and after t there is "non-word" character. Ah, yes... i messed up, i think we want here (replace-regexp-in-string "\\_<%t\\_>" "repl" "foo %t bar") i.e. \_< .. \_> to correctly delimit beginning and end of word, not just boundary (i always trip on this!). > Also tried (format-spec "foo-%t-bar" '((?t . "repl"))) ;; which works as > I'd expect. yeah, that's what i use and didn't notice my error above. format-spec is much nicer than a plain regexp subs, one can use format specifiers like %3t and many others, but unfortunately seems to have been introduced in emacs 27. thanks for checking, and if you can confirm the above fix looks better, i'll submit a new version. cheers, jao -- A language that doesn't affect the way you think about programming, is not worth knowing. - Alan Perlis, Epigrams on Programming