OSDN Git Service

support cmigemo as an alternative to migemo-client
authorHiraoka <khi@users.osdn.me>
Wed, 26 Sep 2018 12:46:37 +0000 (21:46 +0900)
committerHiraoka <khi@users.osdn.me>
Sat, 29 Sep 2018 12:14:25 +0000 (21:14 +0900)
ChangeLog
doc/README-j.html
doc/README.ja.rd
howm-mode.el

index ef1fee1..39d9a76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
 
        * update autotools
 
 
        * update autotools
 
+2018-09-27  HIRAOKA Kazuyuki  <khi@users.osdn.me>
+
+       * howm-mode.el
+       (howm-migemo-get-pattern, howm-migemo-client, howm-migemo-client-option):
+       support cmigemo as an alternative to migemo-client
+
 2018-03-31  HIRAOKA Kazuyuki  <khi@users.osdn.me>
 
        * howm-mode.el: fix wrong warning "Requiring howm-mode is obsolete"
 2018-03-31  HIRAOKA Kazuyuki  <khi@users.osdn.me>
 
        * howm-mode.el: fix wrong warning "Requiring howm-mode is obsolete"
index 5a43262..9d75a53 100644 (file)
@@ -1292,6 +1292,13 @@ make test</pre></li>
 <ul>
 <li>¥¹¥Ê¥Ã¥×¥·¥ç¥Ã¥ÈÈÇ
 <ul>
 <ul>
 <li>¥¹¥Ê¥Ã¥×¥·¥ç¥Ã¥ÈÈÇ
 <ul>
+<li>[2018-09-26]
+<ul>
+<li><p>migemo-client ¤Î¤«¤ï¤ê¤Ë cmigemo ¤âÂбþ</p>
+<pre>(setq howm-migemo-client '((type . cmigemo) (command . "cmigemo")))
+(setq howm-migemo-client-option
+      '("-q" "-d" "/usr/share/cmigemo/utf-8/migemo-dict"))</pre></li>
+</ul></li>
 <li>[2018-02-12]
 <ul>
 <li>autotools ¤Þ¤ï¤ê¤òÁݽü</li>
 <li>[2018-02-12]
 <ul>
 <li>autotools ¤Þ¤ï¤ê¤òÁݽü</li>
index 3e508e4..d41a2da 100644 (file)
@@ -927,6 +927,11 @@ Emacs 
 thx > patch¡¦²þÎÉ°Æ¡¦»ØŦ¤ò¤¯¤À¤µ¤Ã¤¿³§ÍÍ
 
 * ¥¹¥Ê¥Ã¥×¥·¥ç¥Ã¥ÈÈÇ
 thx > patch¡¦²þÎÉ°Æ¡¦»ØŦ¤ò¤¯¤À¤µ¤Ã¤¿³§ÍÍ
 
 * ¥¹¥Ê¥Ã¥×¥·¥ç¥Ã¥ÈÈÇ
+  * [2018-09-26]
+    * migemo-client ¤Î¤«¤ï¤ê¤Ë cmigemo ¤âÂбþ
+        (setq howm-migemo-client '((type . cmigemo) (command . "cmigemo")))
+        (setq howm-migemo-client-option
+              '("-q" "-d" "/usr/share/cmigemo/utf-8/migemo-dict"))
   * [2018-02-12]
     * autotools ¤Þ¤ï¤ê¤òÁݽü
     * ¥Õ¥é¥ó¥¹¸ì¥á¥Ë¥å¡¼¤òÄɲÃ
   * [2018-02-12]
     * autotools ¤Þ¤ï¤ê¤òÁݽü
     * ¥Õ¥é¥ó¥¹¸ì¥á¥Ë¥å¡¼¤òÄɲÃ
index ec7b978..469522d 100644 (file)
@@ -109,10 +109,19 @@ It is further registered globally if global-p is non-nil."
 
 (howm-defvar-risky howm-migemo-client nil
   "Command name of migemo-client.
 
 (howm-defvar-risky howm-migemo-client nil
   "Command name of migemo-client.
-Try (setq howm-migemo-client \"migemo-client\") for howm-migemo-*.")
+Example of cmigemo:
+  (setq howm-migemo-client '((type . cmigemo) (command . \"cmigemo\")))
+Example of migemo-client (obsolete):
+  (setq howm-migemo-client \"migemo-client\")
+See also `howm-migemo-client-option`")
 (howm-defvar-risky howm-migemo-client-option nil
   "List of option for migemo-client.
 (howm-defvar-risky howm-migemo-client-option nil
   "List of option for migemo-client.
-e.g. (\"-H\" \"::1\")")
+Example of cmigemo:
+  (setq howm-migemo-client-option
+        '(\"-q\" \"-d\" \"/usr/share/cmigemo/utf-8/migemo-dict\"))
+Example of migemo-client (obsolete):
+  (setq howm-migemo-client-option '(\"-H\" \"::1\")
+See also `howm-migemo-client`")
 
 ;;; --- level 2 ---
 
 
 ;;; --- level 2 ---
 
@@ -491,30 +500,19 @@ key       binding
 (defun howm-migemo-get-pattern (roma type)
   (when (and (null howm-migemo-client) (not howm-view-use-grep))
     (require 'migemo))
 (defun howm-migemo-get-pattern (roma type)
   (when (and (null howm-migemo-client) (not howm-view-use-grep))
     (require 'migemo))
-  (if (and (featurep 'migemo) (string= type "emacs"))
-      (howm-funcall-if-defined (migemo-get-pattern roma))
-;;       (migemo-get-pattern roma)
-    (car (howm-call-process (or howm-migemo-client "migemo-client")
-                            `(,@howm-migemo-client-option "-t" ,type ,roma)
-                            0))))
-
-;; (defun howm-migemo-get-pattern (roma type)
-;;   (when (and (null (howm-migemo-client)) (not howm-view-use-grep))
-;;     (require 'migemo))
-;;   (if (and (featurep 'migemo) (string= type "emacs"))
-;;       (howm-funcall-if-defined (migemo-get-pattern roma))
-;; ;;       (migemo-get-pattern roma)
-;;     (car (howm-call-process (howm-migemo-client)
-;;                             `(,@(howm-migemo-client-option) "-t" ,type ,roma)
-;;                             0))))
-
-;; (defun howm-migemo-client ()
-;;   (if (stringp howm-migemo-client)
-;;       howm-migemo-client
-;;     (or (car howm-migemo-client) "migemo-client")))
-
-;; (defun howm-migemo-client-option ()
-;;   (cdr-safe howm-migemo-client))
+  (cl-labels ((ref (key) (cdr (assoc key howm-migemo-client))))
+    (cond ((and (featurep 'migemo) (string= type "emacs"))
+           (howm-funcall-if-defined (migemo-get-pattern roma)))
+          ((or (null howm-migemo-client) (stringp howm-migemo-client))
+           (car (howm-call-process (or howm-migemo-client "migemo-client")
+                                   `(,@howm-migemo-client-option "-t" ,type ,roma)
+                                   0)))
+          ((eq (ref 'type) 'cmigemo)
+           (car (howm-call-process (ref 'command)
+                                   `(,@howm-migemo-client-option
+                                     ,@(and (string= type "emacs") '("-e"))
+                                     "-w" ,roma))))
+          (t (error "Invalid howm-migemo-client: %s" howm-migemo-client)))))
 
 (defun howm-normalize-oldp ()
   howm-list-normalizer)
 
 (defun howm-normalize-oldp ()
   howm-list-normalizer)