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 aHgOEURVm2HL1gAAgWs5BA (envelope-from ) for ; Mon, 22 Nov 2021 09:31:00 +0100 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 GHqdDERVm2GnWQAAbx9fmQ (envelope-from ) for ; Mon, 22 Nov 2021 08:31:00 +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 B4D2CC57F for ; Mon, 22 Nov 2021 09:30:58 +0100 (CET) Received: from localhost ([::1]:58986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mp4j3-0002Lk-2n for larch@yhetil.org; Mon, 22 Nov 2021 03:30:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mp4hd-0001ex-KY for emacs-orgmode@gnu.org; Mon, 22 Nov 2021 03:29:29 -0500 Received: from [2a00:1450:4864:20::134] (port=34610 helo=mail-lf1-x134.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mp4hb-0003mE-1n for emacs-orgmode@gnu.org; Mon, 22 Nov 2021 03:29:29 -0500 Received: by mail-lf1-x134.google.com with SMTP id n12so77157901lfe.1 for ; Mon, 22 Nov 2021 00:29:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=Oh0MPBVpSzOW4DG3cvQMGQoAWDderGfyVdE98ZOiahU=; b=O1/4SzznEdRqI0QLSTmOzToN5jwYZyaK6wXf6oA0UXOSX9QT0rvz5OzBS6ehqGUFiy fKAs34kOqNOZQiu/V+LxLNF78sHAYUVP+Mjxf00UUy3UWccQRkXcZv4YLUS/QRqRMtD2 JfBibOQzFGLlFNJ0eemmKAaml9GpA+Qy1HCnfhIi9p17sC4J8H9nI5/8L9CKyMJpDfMr WFcaJHq/OOSA+y3nz5QJjVwo11ylX5bUnVur1Cm7SlPKW3ZtkNxX7ggZESCuQzXwaXxR lkPuVuMI6JN8uBSkpQFIZuwLZsFO3N3KzqXXf9Kmtl6sHKdiL9Ea09Rb257CpHAxXlcD Vf5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Oh0MPBVpSzOW4DG3cvQMGQoAWDderGfyVdE98ZOiahU=; b=VOCpXS/NK/uPItevgzgVmIQcsRlGNAHMrLjOySXnKUoFOXaxqRhBR9kAzUp48BjVyg HmdtwGr/SrRHeErLq8gMnEgr+brfBOzuf9VjQ0RX4E4xEXGBAcOF/qDqMoRugcLffbph j2ppDEZvAlo+gXD2qOTPk51DdNl5JRZNKymMwz9sbCVwP0prWQ5naghjZsMSP6EpykYF zbU+f1gAJ+IxXldrIRpyxCVTENEaEWC0mc/xjdP3+HamgBSG2ewBXXkZPzIWX/t/kojc dRQjfD2zD3Fl7YzNfrq/LZJ9kMlH5zug2qXbj5aTUDgg3PBLuwZA7lK/OUWIph6DQsoD FQXw== X-Gm-Message-State: AOAM530ig1S9P7bXQhCaSp5MXmhWJh1HI/DlKo/+QA9trw/1vOS33HUJ 5+R4X1bp4AthkufLtUcxSNdYZR+erTAWdyKguxxQfnpM X-Google-Smtp-Source: ABdhPJzyzkmOARW0G07rTPZISrDB6YK7tjc5/WkSzwcAK/iGEMXyALRLfumwrnPA3hIxq3nC5bNwpaEcFWPly52gzEQ= X-Received: by 2002:a05:651c:49b:: with SMTP id s27mr48058965ljc.404.1637569764028; Mon, 22 Nov 2021 00:29:24 -0800 (PST) MIME-Version: 1.0 From: Anders Johansson Date: Mon, 22 Nov 2021 09:29:13 +0100 Message-ID: Subject: [BUG?] Cache: org-scan-tags behaves differently on inlinetasks with and without cache To: org-mode-email Content-Type: text/plain; charset="UTF-8" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::134 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=mejlaandersj@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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=1637569858; 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=Oh0MPBVpSzOW4DG3cvQMGQoAWDderGfyVdE98ZOiahU=; b=eqjW8W2vwcpRbYkDKYeP3NJZRE5vEROYWq6WmkfX24rW/JjBuO6AIAigFfADMT2Imt5jGh m4u3bIAvVd9gfycthVbnocdj9qptx8nZs1wU2JBX+hop6WuW/6+GVW//bdbRon3UnOlyEr NnC1zN0fcKo/wspAxwGQ0eF3jR3RrBqUhyZ6Vkflj/Xgl/QTyWGNdo2JBh4RFdgglxzycC Tcdp8PaSyrX3Gyo5E87WS3ooX2JtXBL1Fny7w0zfia3AuFJ8pVvvgNCytwoGxe/FbXQ6d2 739qUdZsFR9pZHNJ47l1C7FL+RBKhiQSQLN2q86+mns7YQTaEjoT2EvIZ9g26g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637569858; a=rsa-sha256; cv=none; b=TDKYF6MVpzVU0JtTJfZZ1SkxpIAfw/eXyXOkKBpCz2KmVdwXfq33n5ZxEiMx9GjZx2zJ0z HhghP5QesjHChfrsE/tmr2FeoD/6aFxWb/tG/GtmS40GjfqOjHXUBmsPmQdWqMwFRw7bTx Vw/EeVZ2w37C6b7G06sZsnga4IZx/PzQkLhRaJfDCoDa1wOy0T7r4EXXjRcbpXatl13/Yc mtVTPQJbWChSkHDNedqC3SI3OmNDoaWj7stu0lfVs9gavKj4oLHn7+dY6soI4KQrDTPVcB zyTobEYy3AzZ/AbF4HXZMcGUPtLL3p5WF8D7Yoki6ZCuonvEm7n63TujrAGfWg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="O1/4Szzn"; 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: -2.58 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="O1/4Szzn"; 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: B4D2CC57F X-Spam-Score: -2.58 X-Migadu-Scanner: scn1.migadu.com X-TUID: Yl3TQFDCiKzs Hi, I use inlinetasks with tags extensively in my library for coding qualitative research data (https://gitlab.com/andersjohansson/orgqda/). With the new org-element caching functionality (which hopefully can provide substantial speedups for my case, thanks Ihor!) I have stumbled on a difference in how inlinetasks are handled by org-scan-tags. Without cache, inlinetasks are matched, but with cache they are not. A minimal test file: #+BEGIN_ORG * Test heading :testtag: Contents * Another heading *************** An inlinetask :testtag: #+END_ORG Executing this code in this file #+BEGIN_SRC emacs-lisp (let ((org-element-use-cache nil)) (org-scan-tags (lambda () (buffer-substring-no-properties (point-at-bol) (point-at-eol))) (cdr (org-make-tags-matcher "testtag")) nil)) #+END_SRC Yields: ("* Test heading :testtag:" "*************** An inlinetask :testtag:") That is, both the headline and inlinetask were matched However: #+BEGIN_SRC (let ((org-element-use-cache t)) (org-scan-tags (lambda () (buffer-substring-no-properties (point-at-bol) (point-at-eol))) (cdr (org-make-tags-matcher "testtag")) nil)) #+END_SRC Yields: ("* Test heading :testtag:") Only the headline was matched. The difference is in org-scan-tags, where the code using cache always retrieves tags for matching with org-get-tags, whereas the code without cache takes tags from group 4 of the scanning regexp ("re"). It appears that org-get-tags doesn't fetch tags for inlinetasks, is this really right? Otherwise, the small patch below gets me the right behaviour (tags returned also for inlinetasks) for these tests. Best, Anders Johansson --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 17b7ff597..98ff5dba7 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11808,7 +11808,7 @@ (defun org-get-tags (&optional pos-or-element local fontify) (org-before-first-heading-p)) (unless (org-element-type pos-or-element) (org-back-to-heading t)) (let ((ltags (if (org-element-type pos-or-element) - (org-element-property :tags (org-element-lineage pos-or-element '(headline) t)) + (org-element-property :tags (org-element-lineage pos-or-element '(headline inlinetask) t)) (org--get-local-tags fontify))) itags) (if (or local (not org-use-tag-inheritance)) ltags -- 2.34.0