summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)