summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKΓ©vin Le Gouguec <kevin.legouguec@gmail.com>2019-01-13 18:46:08 +0100
committerKΓ©vin Le Gouguec <kevin.legouguec@gmail.com>2019-01-13 18:46:08 +0100
commit01d279f8f1008c67b705ab8c759aff10a2282ab2 (patch)
tree1f9103a396ccf8c82e5163e12d1a0a41abd0808f
parent143e59d7d84bf851eadbf57bc24afd79a0e1b31b (diff)
downloaddotfiles-01d279f8f1008c67b705ab8c759aff10a2282ab2.tar.xz
Define my own input method instead of cluttering TeX
-rw-r--r--.emacs27
1 files changed, 13 insertions, 14 deletions
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)