emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* make org-refile auto-recache when needed?
@ 2020-07-15 12:17 Adam Spiers
  2020-08-02  8:48 ` Ihor Radchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Adam Spiers @ 2020-07-15 12:17 UTC (permalink / raw)
  To: org-mode mailing list

Hi all,

I note that when org-refile-use-cache is enabled and the cache becomes
stale, attempting to refile results in this error message (originating
from `org-refile-check-position'):

     Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling

Is there any reason why it couldn't just automatically rebuild the
cache when needed?  If it did that then I struggle to imagine why
anyone would ever *not* want the cache enabled, because in the worst
case org-refile would just behave the same as when the cache is
disabled, and in the best case it would perform a lot faster.

Cheers,
Adam


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make org-refile auto-recache when needed?
  2020-07-15 12:17 make org-refile auto-recache when needed? Adam Spiers
@ 2020-08-02  8:48 ` Ihor Radchenko
  2020-08-02 20:32 ` Samuel Wales
  2020-09-04 14:12 ` Bastien
  2 siblings, 0 replies; 6+ messages in thread
From: Ihor Radchenko @ 2020-08-02  8:48 UTC (permalink / raw)
  To: Adam Spiers, org-mode mailing list

Seconding this. Ideally, refile should also try to perform refiling
after rebuilding the cache.

Best,
Ihor

Adam Spiers <orgmode@adamspiers.org> writes:

> Hi all,
>
> I note that when org-refile-use-cache is enabled and the cache becomes
> stale, attempting to refile results in this error message (originating
> from `org-refile-check-position'):
>
>      Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling
>
> Is there any reason why it couldn't just automatically rebuild the
> cache when needed?  If it did that then I struggle to imagine why
> anyone would ever *not* want the cache enabled, because in the worst
> case org-refile would just behave the same as when the cache is
> disabled, and in the best case it would perform a lot faster.
>
> Cheers,
> Adam
>

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong University, Xi'an, China
Email: yantar92@gmail.com, ihor_radchenko@alumni.sutd.edu.sg


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make org-refile auto-recache when needed?
  2020-07-15 12:17 make org-refile auto-recache when needed? Adam Spiers
  2020-08-02  8:48 ` Ihor Radchenko
@ 2020-08-02 20:32 ` Samuel Wales
  2020-09-04 14:12 ` Bastien
  2 siblings, 0 replies; 6+ messages in thread
From: Samuel Wales @ 2020-08-02 20:32 UTC (permalink / raw)
  To: Adam Spiers; +Cc: org-mode mailing list

i recall wanting this at some point also, and also did not figure out
why one would not want it.

perhaps it thinks you will use an alternate to refiling if you know it
will be too slow.

but it's worth keeping in mind that caching has, or had, bugs.  in
particular, if refile targets are filtered [and you might have more
than one set], a single cache could seemingly get confused.  of course
a solution would be to filter late.

if there is anything else that can be done to speed up refile and
refile goto /without/ caching, that's definitely best.  you have
probably profiled, but make sure your completer [ivy, ido, helm] is
not the bottleneck.  i wish we could get rid of this cache.

On 7/15/20, Adam Spiers <orgmode@adamspiers.org> wrote:
> Hi all,
>
> I note that when org-refile-use-cache is enabled and the cache becomes
> stale, attempting to refile results in this error message (originating
> from `org-refile-check-position'):
>
>      Invalid refile position, please clear the cache with `C-0 C-c C-w'
> before refiling
>
> Is there any reason why it couldn't just automatically rebuild the
> cache when needed?  If it did that then I struggle to imagine why
> anyone would ever *not* want the cache enabled, because in the worst
> case org-refile would just behave the same as when the cache is
> disabled, and in the best case it would perform a lot faster.
>
> Cheers,
> Adam
>
>


-- 
The Kafka Pandemic

What is misopathy?
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make org-refile auto-recache when needed?
  2020-07-15 12:17 make org-refile auto-recache when needed? Adam Spiers
  2020-08-02  8:48 ` Ihor Radchenko
  2020-08-02 20:32 ` Samuel Wales
@ 2020-09-04 14:12 ` Bastien
  2020-09-05 16:20   ` Adam Spiers
  2 siblings, 1 reply; 6+ messages in thread
From: Bastien @ 2020-09-04 14:12 UTC (permalink / raw)
  To: Adam Spiers; +Cc: org-mode mailing list

Hi Adam,

Adam Spiers <orgmode@adamspiers.org> writes:

> I note that when org-refile-use-cache is enabled and the cache becomes
> stale, attempting to refile results in this error message (originating
> from `org-refile-check-position'):
>
>     Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling
>
> Is there any reason why it couldn't just automatically rebuild the
> cache when needed?  

If we can rebuild the cache for refile target in a reliable way, sure,
we should do this.  I had a quick look and this isn't straightforward,
so help is welcome.  I note the idea for after 9.4.

Thanks,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make org-refile auto-recache when needed?
  2020-09-04 14:12 ` Bastien
@ 2020-09-05 16:20   ` Adam Spiers
  2020-09-06  5:09     ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: Adam Spiers @ 2020-09-05 16:20 UTC (permalink / raw)
  To: Bastien; +Cc: org-mode mailing list

Hi Bastien,

On Fri, Sep 04, 2020 at 04:12:08PM +0200, Bastien wrote:
>Adam Spiers <orgmode@adamspiers.org> writes:
>> I note that when org-refile-use-cache is enabled and the cache becomes
>> stale, attempting to refile results in this error message (originating
>> from `org-refile-check-position'):
>>
>>     Invalid refile position, please clear the cache with `C-0 C-c C-w' before refiling
>>
>> Is there any reason why it couldn't just automatically rebuild the
>> cache when needed?
>
>If we can rebuild the cache for refile target in a reliable way, sure,
>we should do this.  I had a quick look and this isn't straightforward,
>so help is welcome.  I note the idea for after 9.4.

Thanks for the reply!

I don't see why we need to be able to rebuild it reliably.  Can't we
just try, then if it succeeds, refile as normal, and if it fails, then
output an error saying that the cache rebuild failed and making a
helpful suggestion of what to try next?  Maybe I'm missing something.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: make org-refile auto-recache when needed?
  2020-09-05 16:20   ` Adam Spiers
@ 2020-09-06  5:09     ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2020-09-06  5:09 UTC (permalink / raw)
  To: Adam Spiers; +Cc: org-mode mailing list

Hi Adam,

Adam Spiers <orgmode@adamspiers.org> writes:

> I don't see why we need to be able to rebuild it reliably.  Can't we
> just try, then if it succeeds, refile as normal, and if it fails, then
> output an error saying that the cache rebuild failed and making a
> helpful suggestion of what to try next?

Maybe.  Please provide a patch so that we better know what we discuss.

Thanks,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-06  5:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 12:17 make org-refile auto-recache when needed? Adam Spiers
2020-08-02  8:48 ` Ihor Radchenko
2020-08-02 20:32 ` Samuel Wales
2020-09-04 14:12 ` Bastien
2020-09-05 16:20   ` Adam Spiers
2020-09-06  5:09     ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).