From 01d279f8f1008c67b705ab8c759aff10a2282ab2 Mon Sep 17 00:00:00 2001 From: Kévin Le Gouguec Date: Sun, 13 Jan 2019 18:46:08 +0100 Subject: Define my own input method instead of cluttering TeX --- .emacs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to '.emacs') diff --git a/.emacs b/.emacs index 7a147fa..f254053 100644 --- a/.emacs +++ b/.emacs @@ -55,20 +55,19 @@ (rg-enable-default-bindings) ; Uses the C-c s prefix. -;; TODO: define my own input method, instead of overloading TeX. -;; Look at unicode-math-input for inspiration, since according to -;; (elisp)Input Methods: "How to define input methods is not yet -;; documented". -(with-temp-buffer - (activate-input-method "TeX") - (let ((quail-current-package (assoc "TeX" quail-package-alist))) - (quail-define-rules ((append . t)) - ("~~" ?≈) ("~=" ?≊) - ;; would like to add ("^=" ?≙), but "^=" already exists - ("..." ?…) - ("-->" ?→) ("-/>" ?↛) ("==>" ?⇒) ("=/>" ?⇏) - ("<--" ?←) ("" ?↔) ("<=>" ?⇔)))) +;; Hopefully these will be easier to remember than TeX commands: + +(require 'quail) +(quail-define-package "my/input-method" "symbols" "𝒰" t + "Input arbitrary symbols with other arbitrary symbols.") + +(mapc (lambda (item) + (quail-defrule (car item) (cdr item) "my/input-method")) + '(("~~" ?≈) ("~=" ?≊) ("^=" ?≙) + ("..." ?…) + ("-->" ?→) ("-/>" ?↛) ("==>" ?⇒) ("=/>" ?⇏) + ("<--" ?←) ("" ?↔) ("<=>" ?⇔))) ;; What's life without a little risk? (setq disabled-command-function nil) -- cgit v1.2.3