diff --git a/zero-framework.el b/zero-framework.el index 357a9cc5f03d5d5b204b7b9ebe91b70e4b96f058..5efec5272068c901773bd08cb855358c52cba4b0 100644 --- a/zero-framework.el +++ b/zero-framework.el @@ -132,7 +132,7 @@ If item is not in lst, return nil." ;; zero-el version (defvar zero-version nil "Zero package version.") -(setq zero-version "1.3.1") +(setq zero-version "1.3.2") ;; FSM state (defconst zero--state-im-off 'IM-OFF) diff --git a/zero-pinyin-service.el b/zero-pinyin-service.el index de66c94c245c90ba725124465595054047b84ce9..d17003465087028a6487765d71b446bd66149f2f 100644 --- a/zero-pinyin-service.el +++ b/zero-pinyin-service.el @@ -71,7 +71,7 @@ Optional argument ARGS extra arguments to pass to the wrapped function." preedit-str the preedit-str, should be pure pinyin string FETCH-SIZE try to fetch this many candidates or more" - (zero-pinyin-service-call "GetCandidates" :string preedit-str :uint32 fetch-size)) + (zero-pinyin-service-call "GetCandidatesV2" :string preedit-str :uint32 fetch-size :uint32 zero-pinyin-fuzzy-flag)) (defun zero-pinyin-service-get-candidates-async (preedit-str fetch-size get-candidates-complete) "Get candidates for pinyin in PREEDIT-STR asynchronously. @@ -80,7 +80,7 @@ PREEDIT-STR the preedit string, should be pure pinyin string. FETCH-SIZE try to fetch this many candidates or more. GET-CANDIDATES-COMPLETE the async handler function." (zero-pinyin-service-async-call - "GetCandidates" get-candidates-complete :string preedit-str :uint32 fetch-size)) + "GetCandidatesV2" get-candidates-complete :string preedit-str :uint32 fetch-size :uint32 zero-pinyin-fuzzy-flag)) (defun zero-pinyin-candidate-pinyin-indices-to-dbus-format (candidate_pinyin_indices) "Convert CANDIDATE_PINYIN_INDICES to Emacs dbus format." @@ -115,18 +115,6 @@ DELETE-CANDIDATE-COMPLETE the async handler function." "Quit panel application." (zero-pinyin-service-async-call "Quit" nil)) -(defun zero-pinyin-service-set-fuzzy-flag (fuzzy-flag) - "Set FuzzyFlag property. - -FUZZY-FLAG should be a natural number. See service interface XML -for flag value and meaning" - (interactive) - (dbus-set-property - :session zero-pinyin-service-service-name - zero-pinyin-service-path - zero-pinyin-service-interface - "FuzzyFlag" fuzzy-flag)) - (provide 'zero-pinyin-service) ;;; zero-pinyin-service.el ends here diff --git a/zero-pinyin.el b/zero-pinyin.el index 5e0aaadf2709f7f940373fa0b62537587a35d251..d732b8e964b651e4a5faa674d26a3b7384b45259 100644 --- a/zero-pinyin.el +++ b/zero-pinyin.el @@ -72,10 +72,7 @@ or online at `zero-pinyin-service-interface-xml-url'." (setq zero-pinyin-state nil) (setq zero-pinyin-used-preedit-str-lengths nil) (setq zero-pinyin-pending-str "") - (setq zero-pinyin-pending-preedit-str "") - (when (null (zero-pinyin-service-set-fuzzy-flag zero-pinyin-fuzzy-flag)) - (unless (zerop zero-pinyin-fuzzy-flag) - (display-warning 'zero-pinyin "Requires zero-pinyin-service v0.9.0 or later to support `zero-pinyin-fuzzy-flag'." :warning)))) + (setq zero-pinyin-pending-preedit-str "")) (defun zero-pinyin-init () "Called when this im is turned on." diff --git a/zero.el b/zero.el index 01f0cb2d1ffeb4d13649b7df3194c00e9326f52f..94eabe0565566f0fc4658ee88b6c1baf044d4c59 100644 --- a/zero.el +++ b/zero.el @@ -12,9 +12,9 @@ ;; See the License for the specific language governing permissions and ;; limitations under the License. -;; Version: 1.3.1 +;; Version: 1.3.2 ;; URL: https://gitlab.emacsos.com/sylecn/zero-el -;; Package-Version: 1.3.1 +;; Package-Version: 1.3.2 ;; Package-Requires: ((emacs "24.3") (s "1.2.0")) ;;; Commentary: @@ -243,7 +243,7 @@ If item is not in lst, return nil." ;; zero-el version (defvar zero-version nil "Zero package version.") -(setq zero-version "1.3.1") +(setq zero-version "1.3.2") ;; FSM state (defconst zero--state-im-off 'IM-OFF) @@ -1128,7 +1128,7 @@ Optional argument ARGS extra arguments to pass to the wrapped function." preedit-str the preedit-str, should be pure pinyin string FETCH-SIZE try to fetch this many candidates or more" - (zero-pinyin-service-call "GetCandidates" :string preedit-str :uint32 fetch-size)) + (zero-pinyin-service-call "GetCandidatesV2" :string preedit-str :uint32 fetch-size :uint32 zero-pinyin-fuzzy-flag)) (defun zero-pinyin-service-get-candidates-async (preedit-str fetch-size get-candidates-complete) "Get candidates for pinyin in PREEDIT-STR asynchronously. @@ -1137,7 +1137,7 @@ PREEDIT-STR the preedit string, should be pure pinyin string. FETCH-SIZE try to fetch this many candidates or more. GET-CANDIDATES-COMPLETE the async handler function." (zero-pinyin-service-async-call - "GetCandidates" get-candidates-complete :string preedit-str :uint32 fetch-size)) + "GetCandidatesV2" get-candidates-complete :string preedit-str :uint32 fetch-size :uint32 zero-pinyin-fuzzy-flag)) (defun zero-pinyin-candidate-pinyin-indices-to-dbus-format (candidate_pinyin_indices) "Convert CANDIDATE_PINYIN_INDICES to Emacs dbus format." @@ -1172,18 +1172,6 @@ DELETE-CANDIDATE-COMPLETE the async handler function." "Quit panel application." (zero-pinyin-service-async-call "Quit" nil)) -(defun zero-pinyin-service-set-fuzzy-flag (fuzzy-flag) - "Set FuzzyFlag property. - -FUZZY-FLAG should be a natural number. See service interface XML -for flag value and meaning" - (interactive) - (dbus-set-property - :session zero-pinyin-service-service-name - zero-pinyin-service-path - zero-pinyin-service-interface - "FuzzyFlag" fuzzy-flag)) - (provide 'zero-pinyin-service) ;; body of zero-pinyin.el @@ -1233,10 +1221,7 @@ or online at `zero-pinyin-service-interface-xml-url'." (setq zero-pinyin-state nil) (setq zero-pinyin-used-preedit-str-lengths nil) (setq zero-pinyin-pending-str "") - (setq zero-pinyin-pending-preedit-str "") - (when (null (zero-pinyin-service-set-fuzzy-flag zero-pinyin-fuzzy-flag)) - (unless (zerop zero-pinyin-fuzzy-flag) - (display-warning 'zero-pinyin "Requires zero-pinyin-service v0.9.0 or later to support `zero-pinyin-fuzzy-flag'." :warning)))) + (setq zero-pinyin-pending-preedit-str "")) (defun zero-pinyin-init () "Called when this im is turned on."