From 77ddd69235d9b9a6ebdf499da9d08fa192cb0419 Mon Sep 17 00:00:00 2001 From: Thierry Volpiatto Date: Sat, 20 Apr 2013 16:55:46 +0200 Subject: [PATCH] * flx-scratch-helm.el: Use candidates-in-buffer to improve performances. --- flx-scratch-helm.el | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/flx-scratch-helm.el b/flx-scratch-helm.el index 61b9a8b..6b3ace3 100644 --- a/flx-scratch-helm.el +++ b/flx-scratch-helm.el @@ -55,27 +55,26 @@ The score info we add here is later removed with another filter." (defun flx-helm-test-candidates () foo-list) -(setq flx-helm-candidate-list-test - '((name . "flx candidate-list-test") - (candidates . flx-helm-test-candidates) - (candidate-transformer flx-helm-candidate-transformer) - (volatile) - (match-strict identity) - )) - +(defvar flx-helm-candidate-list-test + '((name . "flx candidate-list-test") + (init . (lambda () + (helm-init-candidates-in-buffer + 'global (flx-helm-test-candidates)))) + (candidates-in-buffer) + (candidate-transformer flx-helm-candidate-transformer) + (volatile) + (match-strict identity))) (defun flx-helm-demo () (interactive) (helm :sources '(flx-helm-candidate-list-test))) - -(setq flx-helm-no-flx - '((name . "flx no flx") - (candidates . flx-helm-test-candidates) - (volatile) - )) +(defvar flx-helm-no-flx + '((name . "flx no flx") + (candidates . flx-helm-test-candidates) + (volatile))) (defun flx-helm-no-flx () "Test Helm's volatile performance without flx." (interactive) - (helm :sources '(flx-helm-no-flx))) \ No newline at end of file + (helm :sources '(flx-helm-no-flx)))