branch: elpa/anzu
commit c8f3e7b65173505d761034132d709b10b036a5c0
Merge: abb129c5f8 962c425d39
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>

    Merge pull request #35 from syohex/better-migemo-checking
    
    Better checking whether using migemo
---
 anzu.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/anzu.el b/anzu.el
index 9d1a26b15e..76b3404657 100644
--- a/anzu.el
+++ b/anzu.el
@@ -159,6 +159,12 @@
          (setq str (regexp-quote str)))
         (t str)))
 
+(defsubst anzu--use-migemo-p ()
+  (when anzu-use-migemo
+    (unless (featurep 'migemo)
+      (error "Error: migemo is not loaded"))
+    migemo-isearch-enable-p))
+
 (defun anzu--search-all-position (str)
   (unless anzu--last-command
     (setq anzu--last-command last-command))
@@ -171,7 +177,7 @@
               (count 0)
               (overflow nil)
               (finish nil)
-              (search-func (if (and anzu-use-migemo migemo-isearch-enable-p)
+              (search-func (if (anzu--use-migemo-p)
                                'migemo-forward
                              're-search-forward))
               (case-fold-search (anzu--case-fold-search input)))

Reply via email to