From 364e666a8ea05719264e04bae5bd1a6cf3360f4e Mon Sep 17 00:00:00 2001 From: rubikitch Date: Wed, 2 Mar 2011 10:32:42 +0900 Subject: [PATCH] anything.el (anything-compute-matches-internal): protect from current-buffer change --- anything.el | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/anything.el b/anything.el index feb4a19..4cf1bed 100644 --- a/anything.el +++ b/anything.el @@ -2010,18 +2010,19 @@ if ITEM-COUNT reaches LIMIT, exit from inner loop." matches)) (defun anything-compute-matches-internal (source) - (let ((matchfns (anything-match-functions source)) - (anything-source-name (assoc-default 'name source)) - (limit (anything-candidate-number-limit source)) - (anything-pattern (anything-process-pattern-transformer - anything-pattern source))) - (anything-process-filtered-candidate-transformer - (if (or (equal anything-pattern "") (equal matchfns '(identity))) - (anything-take-first-elements - (anything-get-cached-candidates source) limit) - (anything-match-from-candidates - (anything-get-cached-candidates source) matchfns limit)) - source))) + (save-current-buffer + (let ((matchfns (anything-match-functions source)) + (anything-source-name (assoc-default 'name source)) + (limit (anything-candidate-number-limit source)) + (anything-pattern (anything-process-pattern-transformer + anything-pattern source))) + (anything-process-filtered-candidate-transformer + (if (or (equal anything-pattern "") (equal matchfns '(identity))) + (anything-take-first-elements + (anything-get-cached-candidates source) limit) + (anything-match-from-candidates + (anything-get-cached-candidates source) matchfns limit)) + source)))) ;; (anything '(((name . "error")(candidates . (lambda () (hage))) (action . identity)))) -- 2.11.4.GIT