From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id Ti9dNx4DimASkQAAgWs5BA (envelope-from ) for ; Thu, 29 Apr 2021 02:51:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KBDmMR4DimC5KAAAB5/wlQ (envelope-from ) for ; Thu, 29 Apr 2021 00:51:42 +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 D43051305A for ; Thu, 29 Apr 2021 02:51:41 +0200 (CEST) Received: from localhost ([::1]:59944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbuu3-0007rG-UT for larch@yhetil.org; Wed, 28 Apr 2021 20:51:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbusr-0007rA-RY for emacs-orgmode@gnu.org; Wed, 28 Apr 2021 20:50:25 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:36462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lbusp-0007gX-04 for emacs-orgmode@gnu.org; Wed, 28 Apr 2021 20:50:25 -0400 Received: by mail-lf1-x12f.google.com with SMTP id n138so102301139lfa.3 for ; Wed, 28 Apr 2021 17:50:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dt9WRyxxYlnqFLtrbSkPYS2PI4l/eGjcx+sq+sFd/vM=; b=SzxgaG+l5gMSNPGJCcLJcPhsiXlO17U6bEFSzqeS9IVSiILanLtpS9Ql15UW1YPmtR bliKQDG+bV9yZo6UAIxZhkHzzJoBDcLonC8PJJtIp7epx4vFNpCthjTb8zNTwnWR1bzp H6GXVep8S/OHr4N1a4aRhC7UYsTYnQqJMycuo7oL3wgvcw7X8kIUC8od0jRp//cUnFUC oCxVCEUsvdQoQo8ygihHDZQyXSe5eMP3dsEz0p4hetQBnUkh0ZARXE0sJ+oCt0HxLcJM 5Ik1DoMc28lKt9FOGvUUhBXYAgoVKsrzxlGvwQiSP3U4EvMPHyTTlsSqG9doEXBVaIzl c8YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dt9WRyxxYlnqFLtrbSkPYS2PI4l/eGjcx+sq+sFd/vM=; b=naI1kwicTc5OTsD0rUFuGrHu0bEao2n9ZugW83wE3//LsNhPoz+aeVEwlIU8fPEXnD CQv7oR7ZWGoOsUjiJ780NmdIUpkRImZSEf9oEqAEv79J7ZJsjkUywoUxEEUcqaJ5rAf2 3yd/6JDwcMLTtgsbnUPA9HaAv1yo+Hbfk06r+UfoLLrPrq+cA639exmm+iA2VxMKFQz7 7ptpM1HggL5sM0oFJFv0sGzhwPQqAsq10JaBN09FnqjaTg9SGU8+ysJ5CbnskNr8ci5J QArR6mS1WWB0ToeiBr2/7eBc9aSXAAyaTtkeqwoGWlzoB16uhq8LWwStuuvle9rkZYZi MnjA== X-Gm-Message-State: AOAM5318cNYjWFDoCbABGzia3Y5SHHCf2BS0YrN5bOIPFJvJ621Q8+hz HA7TVb1Q2yNeZbDID4H+pIMfBSVcpZD62X1jm7A= X-Google-Smtp-Source: ABdhPJzXBuVaApAuo7EyP5Ub2EepDSG0phRPpZ55936JcD/SxWoAdzB3adFicjS9pVt0GvLGb/EgK8dt39jtHRaC45Y= X-Received: by 2002:a19:c112:: with SMTP id r18mr22786143lff.169.1619657419949; Wed, 28 Apr 2021 17:50:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:6504:5f6:0:0:0:0 with HTTP; Wed, 28 Apr 2021 17:50:19 -0700 (PDT) In-Reply-To: References: From: Samuel Wales Date: Wed, 28 Apr 2021 17:50:19 -0700 Message-ID: Subject: Re: [PATCH] Bug: fragile org refile cache To: Maxim Nikulin Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=samologist@gmail.com; helo=mail-lf1-x12f.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: , Cc: emacs-orgmode@gnu.org 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=1619657502; 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=dt9WRyxxYlnqFLtrbSkPYS2PI4l/eGjcx+sq+sFd/vM=; b=MYx6w0hGupxfxKG8JytcyAGrHQt8AkNs6JmVbWXyc3lXNvKU85rvH6jgoRRWi5z69ZClv+ yBaI8nMa2Y5KMdLjuQt9aCHce4RfV7k07RsdI+pXfCXHuu/bEiW86IETm7NDa7vm+w2kPe E7eNZ0A/BTjtaRrOcLAuMg8PYqc7Hd1XXtZ/LfXPrnekKrdUZ2/AnRV9FzHLU/VwcYKWRL faVqsumZedbAY+xUv3rUNjw0jkfFJgHCBTk0S6vNkD78DUJNPnxQ83e9y7PLeyk47gDNHz pYMF5tRutoFX8niPqPP+uVUPJuOmSme7g7jGJiMOrriGNpwCTCHyyKSOn3DyXQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619657502; a=rsa-sha256; cv=none; b=US17J49+NUC/zkrwhKF6NA2yJZX5lgkqvMUFkYLdZF8JjF/dS5rKwIoOpMp1Sj+nXQCrQA LPi367AwxCswy2owRftFRNVDnbZVyUl4ZUSHRhz+5zeozmZwRMRhN5qlFGpI194/HjXZH9 zD5/dLyqRa5HgUdETZ+7602DybY/RWqBcb00VIjXht8PPcJN6VBDFOyNU+xSQFdYu4mmYf Upwn/Wf6v8mx67GaBEb2DnASBKnN05Nf+jEvWDz2WIiAsseVvfa6XrrXlMWM7JAENHV1hw O1WwLmGVltAvtH0jj5GVojCntfOH+Gw3mMSKnz+oC/qFEfp1RchVc7PuuQCG3A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=SzxgaG+l; 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.15 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=SzxgaG+l; 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: D43051305A X-Spam-Score: -3.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: y0zx1YcbPZXS long ago i used to use the refile cache. i think it is probably not widely used, or maybe even not at all. the reason i stopped was behavior that sounds similar to your description. such as, it would produce a set of results that did not match the calling conditions. i cannot reach the thread you point to, however. what i did was use ido-hacks to speed up ido and restrict to :goto: and :refile: tagged entries for common targets. this worked for me; it is fast despite my huge set of olpaths. it would be great if the cache were unnecessary. that might nt work for you, but perhaps this provides confirmation or ideas for you. On 4/28/21, Maxim Nikulin wrote: > Reviewing my attempt to speedup collecting of refile targets > https://orgmode.org/list/s209r8$16en$1@ciao.gmane.io/ > I have realized that refile cache is unreliable. > > With specific customization, cache content and thus refile targets > depend on the function called first: `org-refile' ([C-u] C-c C-w) or > `org-goto' (C-u C-c C-w). > > I decided to try to provide minimal example and steps to reproduce in > the form of a test marked as expected failure. > > Certainly cache should be enabled > (org-refile-use-cache t) > `org-refile-targets' should have (nil . (:maxlevel . 5)) for the > affected buffer. The value of the following setting is intentionally set > to alternative value in comparison to `org-goto' code > (org-refile-use-outline-path nil) > To see the issue interactively, you likely should set > (org-outline-path-complete-in-steps nil) > > Clean cache (C-u C-u C-u C-c C-w) and try jumping using C-u C-c C-w and > C-u C-c C-j in various order. Use TAB completion to see targets. > > To make difference more apparent, define > `org-refile-target-verify-function' to filter-out some headings. > > My expectation that each command has list of targets formatted > accordingly to user setting or `org-goto' internal overrides. Actually > lists of target are the same since they share cache entry. > > I suppose, cache keys should include values of all parameters affecting > filtering and formatting, not only regexp for heading selection. > > However I have no idea how to derive some value suitable for cache key > from `org-refile-target-verify-function'. > -- The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html