summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Hendershott <git@greghendershott.com>2019-07-18 16:54:29 -0400
committerGreg Hendershott <git@greghendershott.com>2019-07-20 20:33:55 -0400
commit0a9e6987d13e367feaca21a51a1a8af95c6b7e87 (patch)
tree16a9294f7e35bdcd69cdb0c0785f43780490d078
parent58cf0994685d4ba272b3efc5fa7ff509b71fdc16 (diff)
Input method: Add Turnstile chars and customization tip; closes #393
-rw-r--r--doc/racket-mode.texi18
-rw-r--r--racket-unicode-input-method.el284
2 files changed, 178 insertions, 124 deletions
diff --git a/doc/racket-mode.texi b/doc/racket-mode.texi
index 0c904dd..e58dbc3 100644
--- a/doc/racket-mode.texi
+++ b/doc/racket-mode.texi
@@ -1357,11 +1357,29 @@ few other examples:
@tab 𝔸
@item test-->>E
@tab test-->>∃ (racket/redex)
+@item vdash
+@tab ⊢
@end multitable
To see a table of all key sequences use ``M-x
describe-input-method <RET> racket-unicode''.
+If you want to add your own mappings to the ``racket-unicode''
+input method, you may add code like the following example in your
+Emacs init file:
+
+@lisp
+;; Either (require 'racket-mode) here, or, if you use
+;; use-package, put the code below in the :config section.
+(with-temp-buffer
+ (racket-unicode-input-method-enable)
+ (set-input-method "racket-unicode")
+ (let ((quail-current-package (assoc "racket-unicode"
+ quail-package-alist)))
+ (quail-define-rules ((append . t))
+ ("^o" ["ᵒ"]))))
+@end lisp
+
If you don’t like the highlighting of partially matching tokens you
can turn it off by setting @code{input-method-highlight-flag} to nil.
diff --git a/racket-unicode-input-method.el b/racket-unicode-input-method.el
index 7ef9fb5..f716ae2 100644
--- a/racket-unicode-input-method.el
+++ b/racket-unicode-input-method.el
@@ -1,6 +1,6 @@
;;; racket-unicode-input-method.el --- Racket Unicode helper functions
-;; Copyright (c) 2015-2016 by Greg Hendershott
+;; Copyright (c) 2015-2019 by Greg Hendershott
;; Portions Copyright (c) 2010-2011 by Roel van Dijk
;; Author: Greg Hendershott
@@ -50,10 +50,27 @@ few other examples:
| x^1 | x¹ |
| A | 𝔸 |
| test-->>E | test-->>∃ (racket/redex) |
+| vdash | ⊢ |
To see a table of all key sequences use \"M-x
describe-input-method <RET> racket-unicode\".
+If you want to add your own mappings to the \"racket-unicode\"
+input method, you may add code like the following example in your
+Emacs init file:
+
+#+BEGIN_SRC elisp
+ ;; Either (require 'racket-mode) here, or, if you use
+ ;; use-package, put the code below in the :config section.
+ (with-temp-buffer
+ (racket-unicode-input-method-enable)
+ (set-input-method \"racket-unicode\")
+ (let ((quail-current-package (assoc \"racket-unicode\"
+ quail-package-alist)))
+ (quail-define-rules ((append . t))
+ (\"^o\" [\"ᵒ\"]))))
+#+END_SRC
+
If you don’t like the highlighting of partially matching tokens you
can turn it off by setting `input-method-highlight-flag' to nil."
(interactive)
@@ -79,141 +96,160 @@ can turn it off by setting `input-method-highlight-flag' to nil."
(quail-define-rules
;; Typed Racket
- ("All" ["∀"])
- ("Union" ["U"])
- ("Intersection" ["∩"])
- ;; These would be nice except no such aliases provided by racket/contract.
- ;; ("->" ["→"])
- ;; ("case->" ["case→"])
+ ("All " ["∀"])
+ ("Union " ["U"])
+ ("Intersection " ["∩"])
;; Redex
- ("test-->>E" ["test-->>∃"])
+ ("test-->>E " ["test-->>∃"])
+
+ ;; Turnstile
+ ("vdash " ["⊢"])
+ ("gg " ["≫"])
+ ("rightarrow " ["→"])
+ ("Rightarrow " ["⇒"])
+ ("Leftarrow " ["⇐"])
+ ("succ " ["≻"])
+
+ ;; Other type rule symbols
+ ("times " ["×"])
+ ("Uparrow " ["⇑"])
+ ("Downarrow " ["⇓"])
+ ("vee " ["∨"])
+ ("wedge " ["∧"])
+ ("sqsubset " ["⊏"])
+ ("sqsupset " ["⊐"])
+ ("sqsubseteq " ["⊑"])
+ ("sqsupseteq " ["⊒"])
+ ("sqcap " ["⊓"])
+ ("sqcup " ["⊔"])
+ ("models " ["⊧"])
;; Greek letters
- ("alpha " ["α"])
- ("Alpha " ["Α"])
- ("beta " ["β"])
- ("Beta " ["Β"])
- ("gamma " ["γ"])
- ("Gamma " ["Γ"])
- ("delta " ["δ"])
- ("Delta " ["Δ"])
- ("epsilon " ["ε"])
- ("Epsilon " ["Ε"])
- ("zeta " ["ζ"])
- ("Zeta " ["Ζ"])
- ("eta " ["η"])
- ("Eta " ["Η"])
- ("theta " ["θ"])
- ("Theta " ["Θ"])
- ("iota " ["ι"])
- ("Iota " ["Ι"])
- ("kappa " ["κ"])
- ("Kappa " ["Κ"])
- ("lambda " ["λ"])
- ("Lambda " ["Λ"])
- ("lamda " ["λ"])
- ("Lamda " ["Λ"])
- ("mu " ["μ"])
- ("Mu " ["Μ"])
- ("nu " ["ν"])
- ("Nu " ["Ν"])
- ("xi " ["ξ"])
- ("Xi " ["Ξ"])
- ("omicron " ["ο"])
- ("Omicron " ["Ο"])
- ("pi " ["π"])
- ("Pi " ["Π"])
- ("rho " ["ρ"])
- ("Rho " ["Ρ"])
- ("sigma " ["σ"])
- ("Sigma " ["Σ"])
- ("tau " ["τ"])
- ("Tau " ["Τ"])
- ("upsilon " ["υ"])
- ("Upsilon " ["Υ"])
- ("phi " ["φ"])
- ("Phi " ["Φ"])
- ("chi " ["χ"])
- ("Chi " ["Χ"])
- ("psi " ["ψ"])
- ("Psi " ["Ψ"])
- ("omega " ["ω"])
- ("Omega " ["Ω"])
- ("digamma " ["ϝ"])
- ("Digamma " ["Ϝ"])
- ("san " ["ϻ"])
- ("San " ["Ϻ"])
- ("qoppa " ["ϙ"])
- ("Qoppa " ["Ϙ"])
- ("sampi " ["ϡ"])
- ("Sampi " ["Ϡ"])
- ("stigma " ["ϛ"])
- ("Stigma " ["Ϛ"])
- ("heta " ["ͱ"])
- ("Heta " ["Ͱ"])
- ("sho " ["ϸ"])
- ("Sho " ["Ϸ"])
+ ("alpha " ["α"])
+ ("Alpha " ["Α"])
+ ("beta " ["β"])
+ ("Beta " ["Β"])
+ ("gamma " ["γ"])
+ ("Gamma " ["Γ"])
+ ("delta " ["δ"])
+ ("Delta " ["Δ"])
+ ("epsilon " ["ε"])
+ ("Epsilon " ["Ε"])
+ ("zeta " ["ζ"])
+ ("Zeta " ["Ζ"])
+ ("eta " ["η"])
+ ("Eta " ["Η"])
+ ("theta " ["θ"])
+ ("Theta " ["Θ"])
+ ("iota " ["ι"])
+ ("Iota " ["Ι"])
+ ("kappa " ["κ"])
+ ("Kappa " ["Κ"])
+ ("lambda " ["λ"])
+ ("Lambda " ["Λ"])
+ ("lamda " ["λ"])
+ ("Lamda " ["Λ"])
+ ("mu " ["μ"])
+ ("Mu " ["Μ"])
+ ("nu " ["ν"])
+ ("Nu " ["Ν"])
+ ("xi " ["ξ"])
+ ("Xi " ["Ξ"])
+ ("omicron " ["ο"])
+ ("Omicron " ["Ο"])
+ ("pi " ["π"])
+ ("Pi " ["Π"])
+ ("rho " ["ρ"])
+ ("Rho " ["Ρ"])
+ ("sigma " ["σ"])
+ ("Sigma " ["Σ"])
+ ("tau " ["τ"])
+ ("Tau " ["Τ"])
+ ("upsilon " ["υ"])
+ ("Upsilon " ["Υ"])
+ ("phi " ["φ"])
+ ("Phi " ["Φ"])
+ ("chi " ["χ"])
+ ("Chi " ["Χ"])
+ ("psi " ["ψ"])
+ ("Psi " ["Ψ"])
+ ("omega " ["ω"])
+ ("Omega " ["Ω"])
+ ("digamma " ["ϝ"])
+ ("Digamma " ["Ϝ"])
+ ("san " ["ϻ"])
+ ("San " ["Ϻ"])
+ ("qoppa " ["ϙ"])
+ ("Qoppa " ["Ϙ"])
+ ("sampi " ["ϡ"])
+ ("Sampi " ["Ϡ"])
+ ("stigma " ["ϛ"])
+ ("Stigma " ["Ϛ"])
+ ("heta " ["ͱ"])
+ ("Heta " ["Ͱ"])
+ ("sho " ["ϸ"])
+ ("Sho " ["Ϸ"])
;; Double-struck letters
- ("|A|" ["𝔸"])
- ("|B|" ["𝔹"])
- ("|C|" ["ℂ"])
- ("|D|" ["𝔻"])
- ("|E|" ["𝔼"])
- ("|F|" ["𝔽"])
- ("|G|" ["𝔾"])
- ("|H|" ["ℍ"])
- ("|I|" ["𝕀"])
- ("|J|" ["𝕁"])
- ("|K|" ["𝕂"])
- ("|L|" ["𝕃"])
- ("|M|" ["𝕄"])
- ("|N|" ["ℕ"])
- ("|O|" ["𝕆"])
- ("|P|" ["ℙ"])
- ("|Q|" ["ℚ"])
- ("|R|" ["ℝ"])
- ("|S|" ["𝕊"])
- ("|T|" ["𝕋"])
- ("|U|" ["𝕌"])
- ("|V|" ["𝕍"])
- ("|W|" ["𝕎"])
- ("|X|" ["𝕏"])
- ("|Y|" ["𝕐"])
- ("|Z|" ["ℤ"])
- ("|gamma|" ["ℽ"])
- ("|Gamma|" ["ℾ"])
- ("|pi|" ["ℼ"])
- ("|Pi|" ["ℿ"])
+ ("|A|" ["𝔸"])
+ ("|B|" ["𝔹"])
+ ("|C|" ["ℂ"])
+ ("|D|" ["𝔻"])
+ ("|E|" ["𝔼"])
+ ("|F|" ["𝔽"])
+ ("|G|" ["𝔾"])
+ ("|H|" ["ℍ"])
+ ("|I|" ["𝕀"])
+ ("|J|" ["𝕁"])
+ ("|K|" ["𝕂"])
+ ("|L|" ["𝕃"])
+ ("|M|" ["𝕄"])
+ ("|N|" ["ℕ"])
+ ("|O|" ["𝕆"])
+ ("|P|" ["ℙ"])
+ ("|Q|" ["ℚ"])
+ ("|R|" ["ℝ"])
+ ("|S|" ["𝕊"])
+ ("|T|" ["𝕋"])
+ ("|U|" ["𝕌"])
+ ("|V|" ["𝕍"])
+ ("|W|" ["𝕎"])
+ ("|X|" ["𝕏"])
+ ("|Y|" ["𝕐"])
+ ("|Z|" ["ℤ"])
+ ("|gamma|" ["ℽ"])
+ ("|Gamma|" ["ℾ"])
+ ("|pi|" ["ℼ"])
+ ("|Pi|" ["ℿ"])
;; Quantifiers
- ("forall" ["∀"])
- ("exists" ["∃"])
+ ("forall " ["∀"])
+ ("exists " ["∃"])
;; Numeric subscripts
- ("_0 " ["₀"])
- ("_1 " ["₁"])
- ("_2 " ["₂"])
- ("_3 " ["₃"])
- ("_4 " ["₄"])
- ("_5 " ["₅"])
- ("_6 " ["₆"])
- ("_7 " ["₇"])
- ("_8 " ["₈"])
- ("_9 " ["₉"])
+ ("_0 " ["₀"])
+ ("_1 " ["₁"])
+ ("_2 " ["₂"])
+ ("_3 " ["₃"])
+ ("_4 " ["₄"])
+ ("_5 " ["₅"])
+ ("_6 " ["₆"])
+ ("_7 " ["₇"])
+ ("_8 " ["₈"])
+ ("_9 " ["₉"])
;; Numeric superscripts
- ("^0 " ["⁰"])
- ("^1 " ["¹"])
- ("^2 " ["²"])
- ("^3 " ["³"])
- ("^4 " ["⁴"])
- ("^5 " ["⁵"])
- ("^6 " ["⁶"])
- ("^7 " ["⁷"])
- ("^8 " ["⁸"])
- ("^9 " ["⁹"]))
+ ("^0 " ["⁰"])
+ ("^1 " ["¹"])
+ ("^2 " ["²"])
+ ("^3 " ["³"])
+ ("^4 " ["⁴"])
+ ("^5 " ["⁵"])
+ ("^6 " ["⁶"])
+ ("^7 " ["⁷"])
+ ("^8 " ["⁸"])
+ ("^9 " ["⁹"]))
(provide 'racket-unicode-input-method)