Klimi's new dotfiles with stow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

300 lines
8.2 KiB

5 years ago
  1. ;;; haskell-unicode-input-method.el --- Haskell Unicode helper functions -*- coding: utf-8; lexical-binding: t -*-
  2. ;; Copyright (C) 2010-2011 Roel van Dijk
  3. ;; Author: Roel van Dijk <vandijk.roel@gmail.com>
  4. ;; This file is not part of GNU Emacs.
  5. ;; This file is free software; you can redistribute it and/or modify
  6. ;; it under the terms of the GNU General Public License as published by
  7. ;; the Free Software Foundation; either version 3 of the License, or
  8. ;; (at your option) any later version.
  9. ;; This file is distributed in the hope that it will be useful,
  10. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ;; GNU General Public License for more details.
  13. ;; You should have received a copy of the GNU General Public License
  14. ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ;;; Commentary:
  16. ;;; Code:
  17. (require 'quail)
  18. ;;;###autoload
  19. (defun turn-on-haskell-unicode-input-method ()
  20. "Set input method `haskell-unicode'."
  21. (interactive)
  22. (set-input-method "haskell-unicode"))
  23. (quail-define-package
  24. "haskell-unicode" ;; name
  25. "UTF-8" ;; language
  26. "\\" ;; title
  27. t ;; guidance
  28. "Haskell Unicode input method.
  29. Designed to be used with the Haskell UnicodeSyntax language
  30. extension in combination with the x-unicode-symbols set of
  31. packages (base-unicode-symbols and containers-unicode-symbols).
  32. " ;; docstring
  33. nil ;; translation-keys
  34. nil ;; forget-last-selection
  35. nil ;; deterministic
  36. nil ;; kbd-translate
  37. nil ;; show-layout
  38. nil ;; create-decode-map
  39. nil ;; maximum-shortest
  40. nil ;; overlay-plist
  41. nil ;; update-translation-function
  42. nil ;; conversion-keys
  43. t ;; simple
  44. )
  45. (quail-define-rules
  46. ;; Greek letters
  47. ("alpha " ["α"])
  48. ("Alpha " ["Α"])
  49. ("beta " ["β"])
  50. ("Beta " ["Β"])
  51. ("gamma " ["γ"])
  52. ("Gamma " ["Γ"])
  53. ("delta " ["δ"])
  54. ("Delta " ["Δ"])
  55. ("epsilon " ["ε"])
  56. ("Epsilon " ["Ε"])
  57. ("zeta " ["ζ"])
  58. ("Zeta " ["Ζ"])
  59. ("eta " ["η"])
  60. ("Eta " ["Η"])
  61. ("theta " ["θ"])
  62. ("Theta " ["Θ"])
  63. ("iota " ["ι"])
  64. ("Iota " ["Ι"])
  65. ("kappa " ["κ"])
  66. ("Kappa " ["Κ"])
  67. ("lambda " ["λ"])
  68. ("Lambda " ["Λ"])
  69. ("lamda " ["λ"])
  70. ("Lamda " ["Λ"])
  71. ("mu " ["μ"])
  72. ("Mu " ["Μ"])
  73. ("nu " ["ν"])
  74. ("Nu " ["Ν"])
  75. ("xi " ["ξ"])
  76. ("Xi " ["Ξ"])
  77. ("omicron " ["ο"])
  78. ("Omicron " ["Ο"])
  79. ("pi " ["π"])
  80. ("Pi " ["Π"])
  81. ("rho " ["ρ"])
  82. ("Rho " ["Ρ"])
  83. ("sigma " ["σ"])
  84. ("Sigma " ["Σ"])
  85. ("tau " ["τ"])
  86. ("Tau " ["Τ"])
  87. ("upsilon " ["υ"])
  88. ("Upsilon " ["Υ"])
  89. ("phi " ["φ"])
  90. ("Phi " ["Φ"])
  91. ("chi " ["χ"])
  92. ("Chi " ["Χ"])
  93. ("psi " ["ψ"])
  94. ("Psi " ["Ψ"])
  95. ("omega " ["ω"])
  96. ("Omega " ["Ω"])
  97. ("digamma " ["ϝ"])
  98. ("Digamma " ["Ϝ"])
  99. ("san " ["ϻ"])
  100. ("San " ["Ϻ"])
  101. ("qoppa " ["ϙ"])
  102. ("Qoppa " ["Ϙ"])
  103. ("sampi " ["ϡ"])
  104. ("Sampi " ["Ϡ"])
  105. ("stigma " ["ϛ"])
  106. ("Stigma " ["Ϛ"])
  107. ("heta " ["ͱ"])
  108. ("Heta " ["Ͱ"])
  109. ("sho " ["ϸ"])
  110. ("Sho " ["Ϸ"])
  111. ;; Double-struck letters
  112. ("|A|" ["𝔸"])
  113. ("|B|" ["𝔹"])
  114. ("|C|" [""])
  115. ("|D|" ["𝔻"])
  116. ("|E|" ["𝔼"])
  117. ("|F|" ["𝔽"])
  118. ("|G|" ["𝔾"])
  119. ("|H|" [""])
  120. ("|I|" ["𝕀"])
  121. ("|J|" ["𝕁"])
  122. ("|K|" ["𝕂"])
  123. ("|L|" ["𝕃"])
  124. ("|M|" ["𝕄"])
  125. ("|N|" [""])
  126. ("|O|" ["𝕆"])
  127. ("|P|" [""])
  128. ("|Q|" [""])
  129. ("|R|" [""])
  130. ("|S|" ["𝕊"])
  131. ("|T|" ["𝕋"])
  132. ("|U|" ["𝕌"])
  133. ("|V|" ["𝕍"])
  134. ("|W|" ["𝕎"])
  135. ("|X|" ["𝕏"])
  136. ("|Y|" ["𝕐"])
  137. ("|Z|" [""])
  138. ("|gamma|" [""])
  139. ("|Gamma|" [""])
  140. ("|pi|" [""])
  141. ("|Pi|" [""])
  142. ;; Types
  143. ("::" [""])
  144. ;; Quantifiers
  145. ("forall" [""])
  146. ("exists" [""])
  147. ;; Arrows
  148. ("->" [""])
  149. ;; ("-->" ["⟶"])
  150. ("<-" [""])
  151. ;; ("<--" ["⟵"])
  152. ;; ("<->" ["↔"])
  153. ;; ("<-->" ["⟷"])
  154. ("=>" [""])
  155. ;; ("==>" ["⟹"])
  156. ;; ("<=" ["⇐"])
  157. ;; ("<==" ["⟸"])
  158. ;; ("<=>" ["⇔"])
  159. ;; ("<==>" ["⟺"])
  160. ;; ("|->" ["↦"])
  161. ;; ("|-->" ["⟼"])
  162. ;; ("<-|" ["↤"])
  163. ;; ("<--|" ["⟻"])
  164. ;; ("|=>" ["⤇"])
  165. ;; ("|==>" ["⟾"])
  166. ;; ("<=|" ["⤆"])
  167. ;; ("<==|" ["⟽"])
  168. ("~>" [""])
  169. ;; ("~~>" ["⟿"])
  170. ("<~" [""])
  171. ;; ("<~~" ["⬳"])
  172. ;; (">->" ["↣"])
  173. ;; ("<-<" ["↢"])
  174. ;; ("->>" ["↠"])
  175. ;; ("<<-" ["↞"])
  176. ;; (">->>" ["⤖"])
  177. ;; ("<<-<" ["⬻"])
  178. ;; ("<|-" ["⇽"])
  179. ;; ("-|>" ["⇾"])
  180. ;; ("<|-|>" ["⇿"])
  181. ;; ("<-/-" ["↚"])
  182. ;; ("-/->" ["↛"])
  183. ;; ("<-|-" ["⇷"])
  184. ;; ("-|->" ["⇸"])
  185. ;; ("<-|->" ["⇹"])
  186. ;; ("<-||-" ["⇺"])
  187. ;; ("-||->" ["⇻"])
  188. ;; ("<-||->" ["⇼"])
  189. ;; ("-o->" ["⇴"])
  190. ;; ("<-o-" ["⬰"])
  191. ;; Boolean operators
  192. ;; ("not" ["¬"])
  193. ("&&" [""])
  194. ("||" [""])
  195. ;; Relational operators
  196. ("==" [""])
  197. ("/=" ["" ""])
  198. ("<=" [""])
  199. (">=" [""])
  200. ("/<" [""])
  201. ("/>" [""])
  202. ;; Arithmetic
  203. ;; (" / " [" ÷ "])
  204. (" * " [""])
  205. ;; Containers / Collections
  206. ;; ("++" ["⧺"])
  207. ;; ("+++" ["⧻"])
  208. ;; ("|||" ["⫴"])
  209. ;; ("empty" ["∅"])
  210. ("elem" [""])
  211. ("notElem" [""])
  212. ("member" [""])
  213. ("notMember" [""])
  214. ("union" [""])
  215. ("intersection" [""])
  216. ("isSubsetOf" [""])
  217. ("isProperSubsetOf" [""])
  218. ;; Other
  219. ;; ("<<" ["≪"])
  220. ;; (">>" ["≫"])
  221. ("<<<" [""])
  222. (">>>" [""])
  223. ("<|" [""])
  224. ("|>" [""])
  225. ("><" [""])
  226. ;; ("mempty" ["∅"])
  227. ("mappend" [""])
  228. ;; ("<*>" ["⊛"])
  229. (" . " [""])
  230. ("undefined" [""])
  231. (":=" [""])
  232. ("=:" [""])
  233. ("=def" [""])
  234. ("=?" [""])
  235. ("..." [""])
  236. ;; Braces
  237. ;; ("[|" ["〚"])
  238. ;; ("|]" ["〛"])
  239. ;; Numeric subscripts
  240. ("_0 " [""])
  241. ("_1 " [""])
  242. ("_2 " [""])
  243. ("_3 " [""])
  244. ("_4 " [""])
  245. ("_5 " [""])
  246. ("_6 " [""])
  247. ("_7 " [""])
  248. ("_8 " [""])
  249. ("_9 " [""])
  250. ;; Numeric superscripts
  251. ("^0 " [""])
  252. ("^1 " ["¹"])
  253. ("^2 " ["²"])
  254. ("^3 " ["³"])
  255. ("^4 " [""])
  256. ("^5 " [""])
  257. ("^6 " [""])
  258. ("^7 " [""])
  259. ("^8 " [""])
  260. ("^9 " [""])
  261. )
  262. (provide 'haskell-unicode-input-method)
  263. ;;; haskell-unicode-input-method.el ends here