From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ZXNIOrikJmFT0gAAgWs5BA (envelope-from ) for ; Wed, 25 Aug 2021 22:14:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gEUjNbikJmHeSAAAbx9fmQ (envelope-from ) for ; Wed, 25 Aug 2021 20:14:48 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 56BF15938 for ; Wed, 25 Aug 2021 22:14:48 +0200 (CEST) Received: from localhost ([::1]:47428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIzIN-0005Yg-1V for larch@yhetil.org; Wed, 25 Aug 2021 16:14:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIzG5-0002pv-Q7 for emacs-orgmode@gnu.org; Wed, 25 Aug 2021 16:12:25 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]:45861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIzG4-0003gE-4D for emacs-orgmode@gnu.org; Wed, 25 Aug 2021 16:12:25 -0400 Received: by mail-lj1-x22a.google.com with SMTP id l18so694815lji.12 for ; Wed, 25 Aug 2021 13:12:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=kGNjPdx8VwozQH05rSZZTePW3PQzoZxxCc8Xvt8kAN4=; b=pzv6w9+xOLwCATbUtW0GTeedWH4WwtsIyltloQQeHiJSmvfZEiEyOPnrikZ8baX4JW u55DE111ZGmM14rigjAfhQA0pvCazK1P0pVVTkNihprhYshxnhXmEbFVZ31bANxCwm8/ 8B4CZ+WfUyNA1KtBeWBZAYWGKLNs8PlRPCFsnTtjZ42YRnC+0ApLt+ao+Ew3lUu9f3vO xwjDjwsDFo3krPX/QTnRswhMo2HeLjih38L+dXc9/Cyw2vu7UYarLqvdg5DhGcogug6v LGpk7GZzNj4bZeYwOAg6pC/kB2YtiWee0rk/BbmlxY9UX7s5JyUiXl3f1v61tjMZ5Syd oWag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=kGNjPdx8VwozQH05rSZZTePW3PQzoZxxCc8Xvt8kAN4=; b=k5kBUvJj8EqETlJAnvsVePj6/ZLXUDXdLkGUPfnC628Dy9cGAeV45P/c5oO/zJ2ehA vKsDLO1lBG/1A8Y4MbO/wMftXs+n3rSnaVy0n9LYjSeqIvBN7OGGg8eecMzOrv8ls22z A1x545uAmYqdi/5Q8PrpYqxZUQIIeW394wG1Rfn5n5DTfNzpXwhYYOtAF6aaXcZYwlTb cHjIToTquAHhWGokfVVoT7YkfFgwL3SgOb44zwdrGP64eLoRzTUnA10RlkoK6AQVKS/j MKEYs9QhmkdnHl3Lqvk+Nr7Ok1nuji9pXDSutl09nNOY5s051BP8Fa2eeaPKrmCL5h8h wFBw== X-Gm-Message-State: AOAM531Kt+7OSCXdsv3M8Y/8qTHY41FkLaPhHI0bzDF5a0WRLxr/KzhJ 4xqMYrN34i61hxw2NHte04S4dC1XGYfhZc4AD2/ckFan6oNQIg== X-Google-Smtp-Source: ABdhPJwSmHkjmtqj0OU05uj5VJv8fuhQL8omHH5DD5MpuKmi3yga8+EdPDCLycXIB6vMbAtuwUTJl2dEeSC5wdftDPs= X-Received: by 2002:a05:651c:311:: with SMTP id a17mr5202ljp.450.1629922341299; Wed, 25 Aug 2021 13:12:21 -0700 (PDT) MIME-Version: 1.0 From: Cassio Koshikumo Date: Wed, 25 Aug 2021 17:12:07 -0300 Message-ID: Subject: [BUG] Creating sparse tree with regexp property matches To: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=ckoshikumo@gmail.com; helo=mail-lj1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1629922488; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=kGNjPdx8VwozQH05rSZZTePW3PQzoZxxCc8Xvt8kAN4=; b=TmDvK4ZmnONzuF6i1y1M+k1WfzaYgoFmbJASsOlJSCmjm/iVdp7tDtiTszzzQYbVo3C9EI 5IZhL/HAmH8sEB2TXZqMG7gy3QEdJr1Ds4EeJWgWfqa4h0U2m6S0EYqiDcXaahIh2mpNyb CY/SN4QY3pSvApwolj/vctbl46TARA97A1b73C4W9/dTVdfglLfnMSiRAQz2fu2IajuUHB VQOz0GLTgXIM7ndBinp9O+YEdGuwS5niplme/j52d+npn9zwwejnis3R5BQPmAqjHY/16b 0ALxj87Zv4Rk2wRbEx9pNWGKNmyY62osCBQUjBq0AHMhJAqNA7eigcDQAtQ3kg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629922488; a=rsa-sha256; cv=none; b=JTwnSGwpNtSY4S/Cnxp4X6llNTueZ+OQkp26rzlDrS/GPWHLh6SNWs6QfLvblESEcqD5aN YwRtMZG9uXQTpv5CActUMRWpgTYZxwGcUayU0P4947j0bbZsAAm01DjDvEHJQXilWNg/ZM ZxVIcYNeIjOcoF4yqLHBO5J60HvLCjEbN61eleDQ+J4mVnLr7GpryfJHS5Y1R8iCoUkLWc K6SHClojp8Sz6CCYILqtP3SX8QPUXp8pA+jw1zVaAgv3/uzMVv72QjaPnUSyH57Z/sg96f /NdX2Aaa5jEbQiu7ulPUmYUwGPf5hpg1ItUiixz40U0Bg0uScZzXLcvlsk2FYg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=pzv6w9+x; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=pzv6w9+x; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 56BF15938 X-Spam-Score: -3.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: C/a0+BJgeTdZ Hello all, I think there's a bug with `org-make-tags-matcher' when creating a sparse tree using property matching with regular expressions and "or" terms. Take the example given in the manual: +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 +With={Sarah|Denny}+SCHEDULED>="<2008-10-11>" If we isolate just this part: +With={Sarah|Denny} The resulting sparse tree does not match the right headings. The function generates the following `tagsmatcher': (progn (setq org-cached-props nil) (or (and (member #("Denny" 0 5 (regexp t)) tags-list)) (and (member "With" tags-list)))) There're checks for "Denny" (as a regexp) and "With" (as a string) --- this is supposed to be the property name, not a search term. They are both checked for in `tags-list'. And, finally, "Sarah" is nowhere to be seen. The problem, as far as I can tell, is that splitting the input at `|' to get the `orterms' does not work with the regular expression the function uses to find the constituent parts of each term. In this example, splitting the input at `|' makes one side get the opening brace and the other the closing brace, while the regexp expects both being present. Since the regexp doesn't fully match, the terms are all parsed wrong. (The function doesn't recognize "With" as property name, for instance.) I'm still messing with it but, for now, don't really know how to fix the problem. I don't 100% understand the function yet... Regards, -- Cassio