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.
 
 
 
 
 
 

301 lines
8.3 KiB

;;; haskell-unicode-input-method.el --- Haskell Unicode helper functions -*- coding: utf-8; lexical-binding: t -*-
;; Copyright (C) 2010-2011 Roel van Dijk
;; Author: Roel van Dijk <vandijk.roel@gmail.com>
;; This file is not part of GNU Emacs.
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3 of the License, or
;; (at your option) any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(require 'quail)
;;;###autoload
(defun turn-on-haskell-unicode-input-method ()
"Set input method `haskell-unicode'.
See Info node `Unicode(haskell-mode)' for more details."
(interactive)
(set-input-method "haskell-unicode"))
(quail-define-package
"haskell-unicode" ;; name
"UTF-8" ;; language
"\\" ;; title
t ;; guidance
"Haskell Unicode input method.
Designed to be used with the Haskell UnicodeSyntax language
extension in combination with the x-unicode-symbols set of
packages (base-unicode-symbols and containers-unicode-symbols).
" ;; docstring
nil ;; translation-keys
nil ;; forget-last-selection
nil ;; deterministic
nil ;; kbd-translate
nil ;; show-layout
nil ;; create-decode-map
nil ;; maximum-shortest
nil ;; overlay-plist
nil ;; update-translation-function
nil ;; conversion-keys
t ;; simple
)
(quail-define-rules
;; 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 " ["Ϸ"])
;; 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|" [""])
;; Types
("::" [""])
;; Quantifiers
("forall" [""])
("exists" [""])
;; Arrows
("->" [""])
;; ("-->" ["⟶"])
("<-" [""])
;; ("<--" ["⟵"])
;; ("<->" ["↔"])
;; ("<-->" ["⟷"])
("=>" [""])
;; ("==>" ["⟹"])
;; ("<=" ["⇐"])
;; ("<==" ["⟸"])
;; ("<=>" ["⇔"])
;; ("<==>" ["⟺"])
;; ("|->" ["↦"])
;; ("|-->" ["⟼"])
;; ("<-|" ["↤"])
;; ("<--|" ["⟻"])
;; ("|=>" ["⤇"])
;; ("|==>" ["⟾"])
;; ("<=|" ["⤆"])
;; ("<==|" ["⟽"])
("~>" [""])
;; ("~~>" ["⟿"])
("<~" [""])
;; ("<~~" ["⬳"])
;; (">->" ["↣"])
;; ("<-<" ["↢"])
;; ("->>" ["↠"])
;; ("<<-" ["↞"])
;; (">->>" ["⤖"])
;; ("<<-<" ["⬻"])
;; ("<|-" ["⇽"])
;; ("-|>" ["⇾"])
;; ("<|-|>" ["⇿"])
;; ("<-/-" ["↚"])
;; ("-/->" ["↛"])
;; ("<-|-" ["⇷"])
;; ("-|->" ["⇸"])
;; ("<-|->" ["⇹"])
;; ("<-||-" ["⇺"])
;; ("-||->" ["⇻"])
;; ("<-||->" ["⇼"])
;; ("-o->" ["⇴"])
;; ("<-o-" ["⬰"])
;; Boolean operators
;; ("not" ["¬"])
("&&" [""])
("||" [""])
;; Relational operators
("==" [""])
("/=" ["" ""])
("<=" [""])
(">=" [""])
("/<" [""])
("/>" [""])
;; Arithmetic
;; (" / " [" ÷ "])
(" * " [""])
;; Containers / Collections
;; ("++" ["⧺"])
;; ("+++" ["⧻"])
;; ("|||" ["⫴"])
;; ("empty" ["∅"])
("elem" [""])
("notElem" [""])
("member" [""])
("notMember" [""])
("union" [""])
("intersection" [""])
("isSubsetOf" [""])
("isProperSubsetOf" [""])
;; Other
;; ("<<" ["≪"])
;; (">>" ["≫"])
("<<<" [""])
(">>>" [""])
("<|" [""])
("|>" [""])
("><" [""])
;; ("mempty" ["∅"])
("mappend" [""])
;; ("<*>" ["⊛"])
(" . " [""])
("undefined" [""])
(":=" [""])
("=:" [""])
("=def" [""])
("=?" [""])
("..." [""])
;; Braces
;; ("[|" ["〚"])
;; ("|]" ["〛"])
;; Numeric subscripts
("_0 " [""])
("_1 " [""])
("_2 " [""])
("_3 " [""])
("_4 " [""])
("_5 " [""])
("_6 " [""])
("_7 " [""])
("_8 " [""])
("_9 " [""])
;; Numeric superscripts
("^0 " [""])
("^1 " ["¹"])
("^2 " ["²"])
("^3 " ["³"])
("^4 " [""])
("^5 " [""])
("^6 " [""])
("^7 " [""])
("^8 " [""])
("^9 " [""])
)
(provide 'haskell-unicode-input-method)
;;; haskell-unicode-input-method.el ends here