From 0620dc8eea53c049c853e947c11f39660c6dfaa6 Mon Sep 17 00:00:00 2001 From: Yuanle Song Date: Sun, 23 Feb 2020 22:47:29 +0800 Subject: [PATCH] v2.7.1 allow user overwrite quote mapping in zero-input-punctuation-full-map --- zero-input-framework.el | 16 ++++++++-------- zero-input.el | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/zero-input-framework.el b/zero-input-framework.el index 0f0c6c9..9ea2f1e 100644 --- a/zero-input-framework.el +++ b/zero-input-framework.el @@ -133,7 +133,7 @@ If item is not in lst, return nil." ;; zero-input-el version (defvar zero-input-version nil "Zero package version.") -(setq zero-input-version "2.7.0") +(setq zero-input-version "2.7.1") ;; FSM state (defconst zero-input--state-im-off 'IM-OFF) @@ -458,13 +458,13 @@ Return CH's Chinese punctuation if CH is converted. Return nil otherwise." "Convert punctuation for `zero-input-punctuation-level-full'. Return CH's Chinese punctuation if CH is converted. Return nil otherwise" - (cl-case ch - (?\" (setq zero-input-double-quote-flag (not zero-input-double-quote-flag)) - (if zero-input-double-quote-flag "“" "”")) - (?\' (setq zero-input-single-quote-flag (not zero-input-single-quote-flag)) - (if zero-input-single-quote-flag "‘" "’")) - (t (or (cadr (assq ch zero-input-punctuation-full-map)) - (zero-input-convert-punctuation-basic ch))))) + (or (zero-input-convert-punctuation-basic ch) + (cadr (assq ch zero-input-punctuation-full-map)) + (cl-case ch + (?\" (setq zero-input-double-quote-flag (not zero-input-double-quote-flag)) + (if zero-input-double-quote-flag "“" "”")) + (?\' (setq zero-input-single-quote-flag (not zero-input-single-quote-flag)) + (if zero-input-single-quote-flag "‘" "’"))))) (defun zero-input-convert-punctuation (ch) "Convert punctuation based on `zero-input-punctuation-level'. diff --git a/zero-input.el b/zero-input.el index 39e251e..0beaa27 100644 --- a/zero-input.el +++ b/zero-input.el @@ -12,7 +12,7 @@ ;; See the License for the specific language governing permissions and ;; limitations under the License. -;; Version: 2.7.0 +;; Version: 2.7.1 ;; URL: https://gitlab.emacsos.com/sylecn/zero-el ;; Package-Requires: ((emacs "24.3") (s "1.2.0")) @@ -251,7 +251,7 @@ If item is not in lst, return nil." ;; zero-input-el version (defvar zero-input-version nil "Zero package version.") -(setq zero-input-version "2.7.0") +(setq zero-input-version "2.7.1") ;; FSM state (defconst zero-input--state-im-off 'IM-OFF) @@ -576,13 +576,13 @@ Return CH's Chinese punctuation if CH is converted. Return nil otherwise." "Convert punctuation for `zero-input-punctuation-level-full'. Return CH's Chinese punctuation if CH is converted. Return nil otherwise" - (cl-case ch - (?\" (setq zero-input-double-quote-flag (not zero-input-double-quote-flag)) - (if zero-input-double-quote-flag "“" "”")) - (?\' (setq zero-input-single-quote-flag (not zero-input-single-quote-flag)) - (if zero-input-single-quote-flag "‘" "’")) - (t (or (cadr (assq ch zero-input-punctuation-full-map)) - (zero-input-convert-punctuation-basic ch))))) + (or (zero-input-convert-punctuation-basic ch) + (cadr (assq ch zero-input-punctuation-full-map)) + (cl-case ch + (?\" (setq zero-input-double-quote-flag (not zero-input-double-quote-flag)) + (if zero-input-double-quote-flag "“" "”")) + (?\' (setq zero-input-single-quote-flag (not zero-input-single-quote-flag)) + (if zero-input-single-quote-flag "‘" "’"))))) (defun zero-input-convert-punctuation (ch) "Convert punctuation based on `zero-input-punctuation-level'. -- GitLab