Caching candidates in Helm functions

20 views
Skip to first unread message

Tianxiang Xiong

unread,
Apr 7, 2018, 8:21:38 PM4/7/18
to emacs-helm
When a Helm source's `:candidates` value is a function, e.g. here, is that function invoked to collect candidates every time the pattern is changed? Or only once from the time a Helm command using that source is invoked to when it's exited?

I'd like to make sure we're not doing unnecessary work in some performance-sensitive commands.


Tianxiang Xiong

unread,
Apr 7, 2018, 8:42:56 PM4/7/18
to emacs-helm
Ah, I think it's the introduction of `:volatile t` that's causing recalculation every time the pattern changes. Does that seem correct?

Thierry Volpiatto

unread,
Apr 7, 2018, 11:38:29 PM4/7/18
to emacs...@googlegroups.com

Tianxiang Xiong <tianxia...@gmail.com> writes:

> Ah, I think it's the introduction of `:volatile t` that's causing
> recalculation every time the pattern changes. Does that seem correct?

Yes, the definition of volatile is in `helm-source` documentation,
perhaps I can rewrite it if it is not clear? Let me know.
See also the definition of `helm-get-cached-candidates` to see exactly
what volatile does.

Note that volatile have no effect on async sources and is used
internally for in-buffer sources so you don't have to use it there.
IOW use it only on sync sources.

--
Thierry
Reply all
Reply to author
Forward
0 new messages