diff options
| author | KΓ©vin Le Gouguec <kevin.legouguec@gmail.com> | 2019-01-13 18:46:08 +0100 |
|---|---|---|
| committer | KΓ©vin Le Gouguec <kevin.legouguec@gmail.com> | 2019-01-13 18:46:08 +0100 |
| commit | 01d279f8f1008c67b705ab8c759aff10a2282ab2 (patch) | |
| tree | 1f9103a396ccf8c82e5163e12d1a0a41abd0808f | |
| parent | 143e59d7d84bf851eadbf57bc24afd79a0e1b31b (diff) | |
| download | dotfiles-01d279f8f1008c67b705ab8c759aff10a2282ab2.tar.xz | |
Define my own input method instead of cluttering TeX
| -rw-r--r-- | .emacs | 27 |
1 files changed, 13 insertions, 14 deletions
@@ -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) |
