From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 CPNKFOMBp2J6aAAAbAwnHQ (envelope-from ) for ; Mon, 13 Jun 2022 11:22:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eKjCEuMBp2IWDgAAauVa8A (envelope-from ) for ; Mon, 13 Jun 2022 11:22:43 +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 E2BEFCDD1 for ; Mon, 13 Jun 2022 11:22:42 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id CA26C5F6E8; Mon, 13 Jun 2022 09:12:49 +0000 (UTC) Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by mail.notmuchmail.org (Postfix) with ESMTPS id 308215F6B8 for ; Mon, 13 Jun 2022 09:12:46 +0000 (UTC) Received: by mail-io1-xd2d.google.com with SMTP id y79so5447196iof.2 for ; Mon, 13 Jun 2022 02:12:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gn2rLGfdxbw3DdTDCkK/GAJz0G71TfGGyMAEsjEE4Bc=; b=d5oG7BZ4JpQfh3haKHZd0ZqQ0FQEDoYR0Sz/zAla+EowbL/Z1VZHO1zDbwr2E2Zchj MS7MtYfIf8ewE5doMcZnq/VwliBPy+L3Nu4NqNZ7izC5P6Y+zh3+7vTSG5Ra7TCbcDjw fK5p2izaPKtRyq56KQTk0R1EG6pwd/iYZmq2QSRcIvGCLGiDQTcGAY4xyxhHiAiJqEUW 9GehaWgpuE4x5qvCVgQneQ81OsnihZlxuJCddGnoYetPkTN37SAvsXPWqcLiO8JVhluO 63lDDo47IpqZVKU5mLuENLpG+rt4NVUPVIxJ/VXFtVrxGy8JkLa0iXaeN0o8tSTfhzvd lTeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gn2rLGfdxbw3DdTDCkK/GAJz0G71TfGGyMAEsjEE4Bc=; b=083gqb432pGrabd9pTy6VFrNBa5hIl0x0mbA/eypjCs7XVHo0yEWC4Hboa9oAchIpj 7sUEIIkNLLW9jT57GCQw83AgHLbKagmSBXSEFgXotvZAphchrrbEkGeYLYvmQJ9l3Wjo kEPWlY0l3x2YkO95wFfYPON32s5Q57twv9yKB+LbFn3DcSrmF/EaPhQVovJFGM0VlmzM S0HpmPljNxnu5wOoML91/HiNdoJNdUM7G+6sqSuV3VNLVpm2ZJsrBrJy29Mp3r8wn01t BfoWcqhb6TzgtO4Fxa2fAYcz4aAfQieQNqyy/AThcKgXVApFQAtKg1QKMLXxubVp88M3 +Edw== X-Gm-Message-State: AOAM5324RDgr2nymFAGgOOOrf0UKV915tN3L7B74s/g0pR9EB/sRYKtX 8qbiSIXWlga/LYdGyD1YMh8VwniQg+E2lVmTUZE= X-Google-Smtp-Source: ABdhPJxpvlxCPmzgehsbmYRpd3rbo9uXivg6rlQ9SWjkmbVvMxElHWoGSFa8GgZdVybq0j3+sTBHpxyB5kS5My89JlE= X-Received: by 2002:a05:6638:16c2:b0:332:3901:d8b7 with SMTP id g2-20020a05663816c200b003323901d8b7mr4886623jat.73.1655111564369; Mon, 13 Jun 2022 02:12:44 -0700 (PDT) MIME-Version: 1.0 References: <87o7yxqxy6.fsf@code.pm> In-Reply-To: <87o7yxqxy6.fsf@code.pm> From: Michael J Gruber Date: Mon, 13 Jun 2022 11:12:33 +0200 Message-ID: Subject: Re: sexp and strings To: erik colson Message-ID-Hash: BOLSEV3V7TNXQHNJOWNPR7QR76IZITQ2 X-Message-ID-Hash: BOLSEV3V7TNXQHNJOWNPR7QR76IZITQ2 X-MailFrom: michaeljgruber@gmail.com 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 CC: notmuch@notmuchmail.org 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=1655112162; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc: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=7+l9LdzCFZZIrytPZQr3K2kpzqzLk2jwn8hdcrswvFs=; b=bbPdEcmIWbR4OTCSpJTaip7ffACb9RozlDwouHG9MIofkZkaL+IvrRNwwzWJ9BZ22+I/cr C23glWJ+3vdP8pcb/ikxMbBEx3dsQEnHmBGL/s1mcgQ27WrKRhRxIs9agRBCb9123ZShA6 oNB4fSzk2zmwtEropE+h5ihpdvTWskvNvTA0G+o4/eWrl+eTYM+kFxI3i9DFkSVt5JzJxM ioPkYafNlfNLy+0T7duKWZL5THQ8ema/+m7SQtl5VMurcP+by+8lqyJrc0vmncpukcpq0f NYy7+cWZCicYJuIAE6L6KPCdDMHiVRnjwAmhYCQ0BjcOhwTisTU6XVAn148bCA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655112162; a=rsa-sha256; cv=none; b=m/gHsHr/KZC6C8ftYTf2+X0I32i7IdZrGU3QfcQHH+m+usAvujzNPtxznLunr2Rz58jAsX JJCKW8mC8rojQsWp4zkOfXC4m920qeB6ilptTN0rhYkJ0GsUUTmnfidsg0xSdHtka5+B2l a3HJAtc5WhmC94WQ7MxWA6kXRc1DgJedTMh3bpERmj9t37KGpiA+UVNUjQzJ95gq3mxQFf Ji8V8qiYmZ1J/bDfCe+ljXE8fJLysrTxv7+P/QS/Gp6I11kGpu2gzNJ3Dwg0Qbly8494+6 og0SP71qSwnNzyXWjtQlAY/Joc0AHpYQV93BbOactxe/NBA4C53P8S+tUsXFhg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=d5oG7BZ4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 13.34 X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=d5oG7BZ4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: E2BEFCDD1 X-Spam-Score: 13.34 X-Migadu-Spam: Yes X-Migadu-Scanner: scn0.migadu.com X-TUID: o5e0hpzrH8Bw Am Mo., 13. Juni 2022 um 01:20 Uhr schrieb erik colson : > > 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 ? That search works without the macro, but not as a macro: notmuch computes an empty `Query()` for this (as per `NOTMUCH_DEBUG_QUERY=1`). I'm not sure whether this is intended or an artefact of the implementation, since both the macro and the regex need expansion/evaluation before being fed to xapian, and the order matters. Defining `D=(macro (dossier) ((tag ,dossier)))` and calling it with `(D (rx ddddd))` works, btw (but is not what you want, obviously), so something tells me lazy evaluation of macros is not completely lazy ;) Michael