• R/O
  • HTTP
  • SSH
  • HTTPS

howm: Commit

Hitori Otegaru Wiki Modoki


Commit MetaInfo

Revision6b37dd03bd31258e9b0cd302ce0284b0d4191be7 (tree)
Time2018-09-29 21:14:25
AuthorHiraoka <khi@user...>
CommiterHiraoka

Log Message

support cmigemo as an alternative to migemo-client

Change Summary

Incremental Difference

--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,12 @@
22
33 * update autotools
44
5+2018-09-27 HIRAOKA Kazuyuki <khi@users.osdn.me>
6+
7+ * howm-mode.el
8+ (howm-migemo-get-pattern, howm-migemo-client, howm-migemo-client-option):
9+ support cmigemo as an alternative to migemo-client
10+
511 2018-03-31 HIRAOKA Kazuyuki <khi@users.osdn.me>
612
713 * howm-mode.el: fix wrong warning "Requiring howm-mode is obsolete"
--- a/doc/README-j.html
+++ b/doc/README-j.html
@@ -1292,6 +1292,13 @@ make test</pre></li>
12921292 <ul>
12931293 <li>スナップショット版
12941294 <ul>
1295+<li>[2018-09-26]
1296+<ul>
1297+<li><p>migemo-client のかわりに cmigemo も対応</p>
1298+<pre>(setq howm-migemo-client '((type . cmigemo) (command . "cmigemo")))
1299+(setq howm-migemo-client-option
1300+ '("-q" "-d" "/usr/share/cmigemo/utf-8/migemo-dict"))</pre></li>
1301+</ul></li>
12951302 <li>[2018-02-12]
12961303 <ul>
12971304 <li>autotools まわりを掃除</li>
--- a/doc/README.ja.rd
+++ b/doc/README.ja.rd
@@ -927,6 +927,11 @@ Emacs
927927 thx > patch・改良案・指摘をくださった皆様
928928
929929 * スナップショット版
930+ * [2018-09-26]
931+ * migemo-client のかわりに cmigemo も対応
932+ (setq howm-migemo-client '((type . cmigemo) (command . "cmigemo")))
933+ (setq howm-migemo-client-option
934+ '("-q" "-d" "/usr/share/cmigemo/utf-8/migemo-dict"))
930935 * [2018-02-12]
931936 * autotools まわりを掃除
932937 * フランス語メニューを追加
--- a/howm-mode.el
+++ b/howm-mode.el
@@ -109,10 +109,19 @@ It is further registered globally if global-p is non-nil."
109109
110110 (howm-defvar-risky howm-migemo-client nil
111111 "Command name of migemo-client.
112-Try (setq howm-migemo-client \"migemo-client\") for howm-migemo-*.")
112+Example of cmigemo:
113+ (setq howm-migemo-client '((type . cmigemo) (command . \"cmigemo\")))
114+Example of migemo-client (obsolete):
115+ (setq howm-migemo-client \"migemo-client\")
116+See also `howm-migemo-client-option`")
113117 (howm-defvar-risky howm-migemo-client-option nil
114118 "List of option for migemo-client.
115-e.g. (\"-H\" \"::1\")")
119+Example of cmigemo:
120+ (setq howm-migemo-client-option
121+ '(\"-q\" \"-d\" \"/usr/share/cmigemo/utf-8/migemo-dict\"))
122+Example of migemo-client (obsolete):
123+ (setq howm-migemo-client-option '(\"-H\" \"::1\")
124+See also `howm-migemo-client`")
116125
117126 ;;; --- level 2 ---
118127
@@ -491,30 +500,19 @@ key binding
491500 (defun howm-migemo-get-pattern (roma type)
492501 (when (and (null howm-migemo-client) (not howm-view-use-grep))
493502 (require 'migemo))
494- (if (and (featurep 'migemo) (string= type "emacs"))
495- (howm-funcall-if-defined (migemo-get-pattern roma))
496-;; (migemo-get-pattern roma)
497- (car (howm-call-process (or howm-migemo-client "migemo-client")
498- `(,@howm-migemo-client-option "-t" ,type ,roma)
499- 0))))
500-
501-;; (defun howm-migemo-get-pattern (roma type)
502-;; (when (and (null (howm-migemo-client)) (not howm-view-use-grep))
503-;; (require 'migemo))
504-;; (if (and (featurep 'migemo) (string= type "emacs"))
505-;; (howm-funcall-if-defined (migemo-get-pattern roma))
506-;; ;; (migemo-get-pattern roma)
507-;; (car (howm-call-process (howm-migemo-client)
508-;; `(,@(howm-migemo-client-option) "-t" ,type ,roma)
509-;; 0))))
510-
511-;; (defun howm-migemo-client ()
512-;; (if (stringp howm-migemo-client)
513-;; howm-migemo-client
514-;; (or (car howm-migemo-client) "migemo-client")))
515-
516-;; (defun howm-migemo-client-option ()
517-;; (cdr-safe howm-migemo-client))
503+ (cl-labels ((ref (key) (cdr (assoc key howm-migemo-client))))
504+ (cond ((and (featurep 'migemo) (string= type "emacs"))
505+ (howm-funcall-if-defined (migemo-get-pattern roma)))
506+ ((or (null howm-migemo-client) (stringp howm-migemo-client))
507+ (car (howm-call-process (or howm-migemo-client "migemo-client")
508+ `(,@howm-migemo-client-option "-t" ,type ,roma)
509+ 0)))
510+ ((eq (ref 'type) 'cmigemo)
511+ (car (howm-call-process (ref 'command)
512+ `(,@howm-migemo-client-option
513+ ,@(and (string= type "emacs") '("-e"))
514+ "-w" ,roma))))
515+ (t (error "Invalid howm-migemo-client: %s" howm-migemo-client)))))
518516
519517 (defun howm-normalize-oldp ()
520518 howm-list-normalizer)
Show on old repository browser