summaryrefslogtreecommitdiff
path: root/helm-multi-match.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2015-09-25 13:27:49 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2015-09-25 13:31:49 +0200
commit2df997bc00236bde1717e90adf4071b199acad27 (patch)
treecc4e6e6ad7578fd4a85c3385096533805e449e41 /helm-multi-match.el
parent9659305698fab8305bec29673c7cace1c48f47ad (diff)
Use caching in helm-mm-migemo-forward (#1175).
* helm-multi-match.el (helm-mm-migemo-forward): Reuse the previously stored regexp if some.
Diffstat (limited to 'helm-multi-match.el')
-rw-r--r--helm-multi-match.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/helm-multi-match.el b/helm-multi-match.el
index 3688de8b..10fa5004 100644
--- a/helm-multi-match.el
+++ b/helm-multi-match.el
@@ -287,13 +287,16 @@ i.e the sources which have the slot :migemo with non--nil value."
always (funcall pred (helm-mm-migemo-string-match re str)))))
(defun helm-mm-migemo-forward (word &optional bound noerror count)
- (let ((regex (if (delq 'ascii (find-charset-string word))
- word
- (concat (migemo-search-pattern-get word) "\\|" word))))
- (with-helm-buffer
+ (with-helm-buffer
+ (unless (assoc word helm-mm--previous-migemo-info)
(setq helm-mm--previous-migemo-info
- (push (cons word regex) helm-mm--previous-migemo-info)))
- (re-search-forward regex bound noerror count)))
+ (push (cons word (if (delq 'ascii (find-charset-string word))
+ word
+ (concat (migemo-search-pattern-get word)
+ "\\|" word)))
+ helm-mm--previous-migemo-info))))
+ (re-search-forward
+ (assoc-default word helm-mm--previous-migemo-info) bound noerror count))
(defun helm-mm-3-migemo-search (pattern &rest _ignore)
(and helm-migemo-mode