Skip to content

Commit

Permalink
Use caching in helm-mm-migemo-forward (#1175).
Browse files Browse the repository at this point in the history
* helm-multi-match.el (helm-mm-migemo-forward):
Reuse the previously stored regexp if some.
  • Loading branch information
thierryvolpiatto committed Sep 25, 2015
1 parent 9659305 commit 2df997b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions helm-multi-match.el
Expand Up @@ -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
Expand Down

0 comments on commit 2df997b

Please sign in to comment.