From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8OG5AGaEp2JghgAAbAwnHQ (envelope-from ) for ; Mon, 13 Jun 2022 20:39:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id yHewAGaEp2I+wgAA9RJhRA (envelope-from ) for ; Mon, 13 Jun 2022 20:39:34 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 726A3258BE for ; Mon, 13 Jun 2022 20:39:33 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id CB8085F6E8; Mon, 13 Jun 2022 18:39:30 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id F063A5F6B8 for ; Mon, 13 Jun 2022 18:39:27 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 82BE45FBD7; Mon, 13 Jun 2022 14:39:26 -0400 (EDT) Received: (nullmailer pid 44124 invoked by uid 1000); Mon, 13 Jun 2022 18:39:25 -0000 From: David Bremner To: erik colson , notmuch@notmuchmail.org Subject: Re: sexp and strings In-Reply-To: <87o7yxqxy6.fsf@code.pm> References: <87o7yxqxy6.fsf@code.pm> Date: Mon, 13 Jun 2022 15:39:25 -0300 Message-ID: <874k0oz9uq.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: X6ROXKKLSMACCBYGJPRA6C33NC2R7MJA X-Message-ID-Hash: X6ROXKKLSMACCBYGJPRA6C33NC2R7MJA 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=1655145573; 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=TVv1mkJk1THh+Ex3svrESrED22Am7mydiu1zLL9oVns=; b=u1EISsavGBoAYSHuBYfZBtbawWcnjyeol3IxjgFnm2HBrYwT72bgvpAliVKwNOs/z1DQaE ZUyBFad76M7YewDnx92eOablAaJ02GGEsPj4L29cqfFbo3G4ZcF8bZcCzLje0CyOPthj6x 55gqytIdg44zTlRJf0TMJKpG/rsXo8y7mn3vCAiMECrYtWLV96SmZXymT4xv1Tf9Teb91B uwicTrzln8kMyDLiwI/Wtb+57jsO6nVWbChhcDgMyUlrkFS5tz67kCQDeZSs1zNiwHf77D Rx+cs6nCBnf1aWsng1gyVLRdluRyidxAtr6xXEGP4A3Dh+xBOqkSLFvGm6V82A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655145573; a=rsa-sha256; cv=none; b=GukziDafkoFZcl3X8TweYceUS8K7jUgJ4EI3GGMXXlD20mhCFewjiRbwrwc/7xLtWTeAtz 3oCrQ8dDnrc5L64m0G7eEWNH6deOLef/+gp+yGIdLyK2iwv5lCmvWa4TnECHmxlbF3liMx Yd1bc05amTw9Fl3GM1ZmYmISaPCBHVRSdNGzHhSLvrRHskCEL/HqhEiaMvuzppLqiaLQIu 4qCOBpnkpm9T/ybR/OHPhRoE9Yp/I2WscCyMKCDmbg5mIN9Bwa20KvG5LYTTrVG8IUj/kL J8g8rtv1K+BIeugZ5RyiZsaRS9rHJTxrTiaTOopoGYg6MqVNaaVcBVBgpGlNLA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 4.38 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 726A3258BE X-Spam-Score: 4.38 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3BWUCIukaxOP erik colson writes: > Hi, > > I would like to define a squery in my notmuch configuration which would > ease a query I often use. The query is > > tag:/ddddd/ > > where ddddd are decimal numbers. > Now I would like to shorten this to > > D ddddd > > wherefor I was thinking of using a macro like: > > D=(macro (dossier) ((tag (regex ,dossier)))) > > But this doesn't seem to do the job. > Any ideas how I can achieve this ? > Although you have one too many sets of (), there is still a bug here. $ notmuch config set squery.D '(macro (dossier) (tag (regex ,dossier))' also doesn't work. Apparently both for regex and wildcard expansion I did not do macro parameter expansion. In the regex case the regex matching for tags actually happens at query construction time, so that's why it ends up as an empty query (presumably none of your tags starts with ,dossier). Anyway, I think I know how to fix this, it will mean that in the corner case of a regex starting with a comma, we'll have to use (regex ",foo").