From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GGWXGJcXl2MUHwEAbAwnHQ (envelope-from ) for ; Mon, 12 Dec 2022 12:59:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iPqIF5cXl2MRGQAAG6o9tA (envelope-from ) for ; Mon, 12 Dec 2022 12:59:19 +0100 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 0C1DDC16F for ; Mon, 12 Dec 2022 12:59:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4hHp-0007XL-Mq; Mon, 12 Dec 2022 06:47:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4hHc-0007VI-DV for emacs-orgmode@gnu.org; Mon, 12 Dec 2022 06:47:47 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4hHY-0005DC-Vs for emacs-orgmode@gnu.org; Mon, 12 Dec 2022 06:47:44 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2A087240107 for ; Mon, 12 Dec 2022 12:47:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1670845659; bh=sVHmPTkYsa7YgzevtUfNre6Y0GDfe7raBJ5hFPALVHY=; h=From:To:Cc:Subject:Date:From; b=gobtQHEcTtasinGVh0mCnwptxulVkfxtVbKp4Yz+aUgBNFB2GXn06Gnz27u+9pKx1 UkD3ob29YnROOhu3+QipIZWsMYyniY7C2xpJYO95ALJDWX3jxWsHg33NEKxW9NJaYl dw2d/v1Fc6Pdqfjl1T9QdZO5ikbT/PwjS7dlC8/O+DC9E6uv5DOFnMRchbe12G1Bma XGoyohbQ+VrzNi9F5EVqUIi53JqS0qnfQBJp1tWpVQD6wE8vm+aUjDpU0Hw87Q5GGY yRInfCmaI7MLd4wRjS13tprWSLpH4SPZbib00EFeNLc7aSkjYedN0DGZe4KXytc6iA iyGcAqGz/FLtw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NW0HG19N9z6tmg; Mon, 12 Dec 2022 12:47:38 +0100 (CET) From: Ihor Radchenko To: rswgnu@gmail.com Cc: Gregor Zattler , emacs-orgmode@gnu.org, hyperbole-users@gnu.org Subject: Re: [BUG] hyperbole action key on path name results in org-element-cache warning [9.6-pre (release_9.5.5-997-ge58bd0 @ /home/grfz/src/org-mode/lisp/)] In-Reply-To: References: <87h6zwbylo.fsf@no.workgroup> <87czak1ex8.fsf@localhost> Date: Mon, 12 Dec 2022 11:47:37 +0000 Message-ID: <87sfhkhmhy.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, 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.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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670846359; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ff7NS6H9jYF+vFAu/TQfeWM5csti/nrkF4XyGeoTy8g=; b=dcTFgzM72/V52K5o4dUAWDuT56OyHYAvbL6cqSqKk0Ey3XV6jvLqbwb5qTelSnQP9S9u7a Ra/fKWNlxgrylwHrpcF4lI3EgRV7GpEzghwnOYELwR53wylgE5yS8XzVLu/3y+Xc2omgYq PuAf7Tw/0ycm9vG0cRNzDw+Z9cvF4mqAns/wMFLBLssoJSRkqT9v3U/LAnhBvMHMl05ggb Gh22zoBA2FvNAA5kAhhpXxqHvI7AwhFChIvtKXfYSpIHOS/DpjVFzLutY/EBpnipKnkRFb BAC1r+RjiaGtrF/IjPWQ6kvgucmPVOfL23bqqYJM+FcE+Gfp7IgeNKd9kal/CA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=gobtQHEc; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670846359; a=rsa-sha256; cv=none; b=fQCXHUS8g5b7nE9vDXpSWLwgqIpqci4GCg36tvpGsvFknDNYWXAP89mf4AHdm+MxwjyJ3Y PmOvzQP5GGsN8VRQjm9MBHAucY16GpRf2ASOfResk+r2I8WFxt8ewrbrjafXHPiFm9BrGt rYswVyFvcJIH/RFvIsoEIMy7CPoSew8PWTLZEODYnZThK8ECFtixbEMKKixP2O0h5oLdXJ OlL6NW2is6DnwVQ4czcPo/WJhHdOLRuV2nMxgScBSmLwlzj1iYmn2O/ZRb6QAmTzYNMaBs 8KD6Twl+9KB8gNcd6fFebtAsq1ZeR8zTJxetwJT9qkGjOS7AvfkeWJ9BHo8vpg== X-Migadu-Spam-Score: -10.55 X-Spam-Score: -10.55 X-Migadu-Queue-Id: 0C1DDC16F X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=gobtQHEc; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net X-TUID: 0N0ZgpsK04SL Robert Weiner writes: > So if we want to determine the Org type of an element outside of an Org > buffer (when using org-type minor modes for example), how would we change > this 'let' code: > > (let* ((context > ;; Only consider supported types, even if they are not > ;; the closest one. > (org-element-lineage > ;; Next line can trigger an error when `looking-at' is called > ;; with a `nil' value of `org-complex-heading-regexp'. > (org-element-context) > '(clock footnote-definition footnote-reference headline > inlinetask link timestamp) > t)) > (type (org-element-type context)) > ...) Strictly speaking, thing at point outside Org buffers is ambiguous because Org syntax is recursive, and we often need to parse buffer from the very beginning to determine what is at point. One needs to load org-mode on text in buffer to know for sure. So, one way to address the issue may be creating an indirect buffer, switching it to Org mode and calling `org-element-context'. Or you can use `org-export-copy-buffer'. The performance may be affected though. Also, you may get unexpected result when trying to match Org object in non-Org buffer when some other text there looks like Org. If necessary, we may also define generic versions of predicates, similar to what is done in `org-at-table-p': When in Org mode, use accurate parser data, but fallback to regexp matching otherwise. Then, we can also modify `org-context' to be generic. If you want the latter, you can help us by searching all the predicate functions to be converted in Org codebase. Then, I can extract them into a separate library org-context.el. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at