/usr/share/emacs/site-lisp/agda/agda-input.el is in agda-mode 2.4.0.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 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 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 | ;;; agda-input.el --- The Agda input method
;;; Commentary:
;; A highly customisable input method which can inherit from other
;; Quail input methods. By default the input method is geared towards
;; the input of mathematical and other symbols in Agda programs.
;;
;; Use M-x customize-group agda-input to customise this input method.
;; Note that the functions defined under "Functions used to tweak
;; translation pairs" below can be used to tweak both the key
;; translations inherited from other input methods as well as the
;; ones added specifically for this one.
;;
;; Use agda-input-show-translations to see all the characters which
;; can be typed using this input method (except for those
;; corresponding to ASCII characters).
;;; Code:
(require 'quail)
(require 'cl)
;; Quail is quite stateful, so be careful when editing this code. Note
;; that with-temp-buffer is used below whenever buffer-local state is
;; modified.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Utility functions
(defun agda-input-concat-map (f xs)
"Concat (map F XS)."
(apply 'append (mapcar f xs)))
(defun agda-input-to-string-list (s)
"Convert a string S to a list of one-character strings, after
removing all space and newline characters."
(agda-input-concat-map
(lambda (c) (if (member c (string-to-list " \n"))
nil
(list (string c))))
(string-to-list s)))
(defun agda-input-character-range (from to)
"A string consisting of the characters from FROM to TO."
(let (seq)
(dotimes (i (1+ (- to from)))
(setq seq (cons (+ from i) seq)))
(concat (nreverse seq))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Functions used to tweak translation pairs
;; lexical-let is used since Elisp lacks lexical scoping.
(defun agda-input-compose (f g)
"\x -> concatMap F (G x)"
(lexical-let ((f1 f) (g1 g))
(lambda (x) (agda-input-concat-map f1 (funcall g1 x)))))
(defun agda-input-or (f g)
"\x -> F x ++ G x"
(lexical-let ((f1 f) (g1 g))
(lambda (x) (append (funcall f1 x) (funcall g1 x)))))
(defun agda-input-nonempty ()
"Only keep pairs with a non-empty first component."
(lambda (x) (if (> (length (car x)) 0) (list x))))
(defun agda-input-prepend (prefix)
"Prepend PREFIX to all key sequences."
(lexical-let ((prefix1 prefix))
(lambda (x) `((,(concat prefix1 (car x)) . ,(cdr x))))))
(defun agda-input-prefix (prefix)
"Only keep pairs whose key sequence starts with PREFIX."
(lexical-let ((prefix1 prefix))
(lambda (x)
(if (equal (substring (car x) 0 (length prefix1)) prefix1)
(list x)))))
(defun agda-input-suffix (suffix)
"Only keep pairs whose key sequence ends with SUFFIX."
(lexical-let ((suffix1 suffix))
(lambda (x)
(if (equal (substring (car x)
(- (length (car x)) (length suffix1)))
suffix1)
(list x)))))
(defun agda-input-drop (ss)
"Drop pairs matching one of the given key sequences.
SS should be a list of strings."
(lexical-let ((ss1 ss))
(lambda (x) (unless (member (car x) ss1) (list x)))))
(defun agda-input-drop-beginning (n)
"Drop N characters from the beginning of each key sequence."
(lexical-let ((n1 n))
(lambda (x) `((,(substring (car x) n1) . ,(cdr x))))))
(defun agda-input-drop-end (n)
"Drop N characters from the end of each key sequence."
(lexical-let ((n1 n))
(lambda (x)
`((,(substring (car x) 0 (- (length (car x)) n1)) .
,(cdr x))))))
(defun agda-input-drop-prefix (prefix)
"Only keep pairs whose key sequence starts with PREFIX.
This prefix is dropped."
(agda-input-compose
(agda-input-drop-beginning (length prefix))
(agda-input-prefix prefix)))
(defun agda-input-drop-suffix (suffix)
"Only keep pairs whose key sequence ends with SUFFIX.
This suffix is dropped."
(lexical-let ((suffix1 suffix))
(agda-input-compose
(agda-input-drop-end (length suffix1))
(agda-input-suffix suffix1))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Customization
;; The :set keyword is set to 'agda-input-incorporate-changed-setting
;; so that the input method gets updated immediately when users
;; customize it. However, the setup functions cannot be run before all
;; variables have been defined. Hence the :initialize keyword is set to
;; 'custom-initialize-default to ensure that the setup is not performed
;; until agda-input-setup is called at the end of this file.
(defgroup agda-input nil
"The Agda input method.
After tweaking these settings you may want to inspect the resulting
translations using `agda-input-show-translations'."
:group 'agda2
:group 'leim)
(defcustom agda-input-tweak-all
'(agda-input-compose
(agda-input-prepend "\\")
(agda-input-nonempty))
"An expression yielding a function which can be used to tweak
all translations before they are included in the input method.
The resulting function (if non-nil) is applied to every
\(KEY-SEQUENCE . TRANSLATION) pair and should return a list of such
pairs. (Note that the translations can be anything accepted by
`quail-defrule'.)
If you change this setting manually (without using the
customization buffer) you need to call `agda-input-setup' in
order for the change to take effect."
:group 'agda-input
:set 'agda-input-incorporate-changed-setting
:initialize 'custom-initialize-default
:type 'sexp)
(defcustom agda-input-inherit
`(("TeX" . (agda-input-compose
(agda-input-drop '("geq" "leq" "bullet" "qed" "par"))
(agda-input-or
(agda-input-drop-prefix "\\")
(agda-input-or
(agda-input-compose
(agda-input-drop '("^o"))
(agda-input-prefix "^"))
(agda-input-prefix "_")))))
)
"A list of Quail input methods whose translations should be
inherited by the Agda input method (with the exception of
translations corresponding to ASCII characters).
The list consists of pairs (qp . tweak), where qp is the name of
a Quail package, and tweak is an expression of the same kind as
`agda-input-tweak-all' which is used to tweak the translation
pairs of the input method.
The inherited translation pairs are added last, after
`agda-input-user-translations' and `agda-input-translations'.
If you change this setting manually (without using the
customization buffer) you need to call `agda-input-setup' in
order for the change to take effect."
:group 'agda-input
:set 'agda-input-incorporate-changed-setting
:initialize 'custom-initialize-default
:type '(repeat (cons (string :tag "Quail package")
(sexp :tag "Tweaking function"))))
(defcustom agda-input-translations
(let ((max-lisp-eval-depth 2800)) `(
;; Equality and similar symbols.
("eq" . ,(agda-input-to-string-list "=∼∽≈≋∻∾∿≀≃⋍≂≅ ≌≊≡≣≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≍≎≏≬⋕"))
("eqn" . ,(agda-input-to-string-list "≠≁ ≉ ≄ ≇≆ ≢ ≭ "))
("=n" . ("≠"))
("~" . ("∼")) ("~n" . ("≁"))
("~~" . ("≈")) ("~~n" . ("≉"))
("~~~" . ("≋"))
(":~" . ("∻"))
("~-" . ("≃")) ("~-n" . ("≄"))
("-~" . ("≂"))
("~=" . ("≅")) ("~=n" . ("≇"))
("~~-" . ("≊"))
("==" . ("≡")) ("==n" . ("≢"))
("===" . ("≣"))
(".=" . ("≐")) (".=." . ("≑"))
(":=" . ("≔")) ("=:" . ("≕"))
("=o" . ("≗"))
("(=" . ("≘"))
("and=" . ("≙")) ("or=" . ("≚"))
("*=" . ("≛"))
("t=" . ("≜"))
("def=" . ("≝"))
("m=" . ("≞"))
("?=" . ("≟"))
;; Inequality and similar symbols.
("leq" . ,(agda-input-to-string-list "<≪⋘≤≦≲ ≶≺≼≾⊂⊆ ⋐⊏⊑ ⊰⊲⊴⋖⋚⋜⋞"))
("leqn" . ,(agda-input-to-string-list "≮ ≰≨≴⋦≸⊀ ⋨⊄⊈⊊ ⋢⋤ ⋪⋬ ⋠"))
("geq" . ,(agda-input-to-string-list ">≫⋙≥≧≳ ≷≻≽≿⊃⊇ ⋑⊐⊒ ⊱⊳⊵⋗⋛⋝⋟"))
("geqn" . ,(agda-input-to-string-list "≯ ≱≩≵⋧≹⊁ ⋩⊅⊉⊋ ⋣⋥ ⋫⋭ ⋡"))
("<=" . ("≤")) (">=" . ("≥"))
("<=n" . ("≰")) (">=n" . ("≱"))
("len" . ("≰")) ("gen" . ("≱"))
("<n" . ("≮")) (">n" . ("≯"))
("<~" . ("≲")) (">~" . ("≳"))
("<~n" . ("⋦")) (">~n" . ("⋧"))
("<~nn" . ("≴")) (">~nn" . ("≵"))
("sub" . ("⊂")) ("sup" . ("⊃"))
("subn" . ("⊄")) ("supn" . ("⊅"))
("sub=" . ("⊆")) ("sup=" . ("⊇"))
("sub=n" . ("⊈")) ("sup=n" . ("⊉"))
("squb" . ("⊏")) ("squp" . ("⊐"))
("squb=" . ("⊑")) ("squp=" . ("⊒"))
("squb=n" . ("⋢")) ("squp=n" . ("⋣"))
;; Set membership etc.
("member" . ,(agda-input-to-string-list "∈∉∊∋∌∍⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿"))
("inn" . ("∉"))
("nin" . ("∌"))
;; Intersections, unions etc.
("intersection" . ,(agda-input-to-string-list "∩⋂∧⋀⋏⨇⊓⨅⋒∏ ⊼ ⨉"))
("union" . ,(agda-input-to-string-list "∪⋃∨⋁⋎⨈⊔⨆⋓∐⨿⊽⊻⊍⨃⊎⨄⊌∑⅀"))
("and" . ("∧")) ("or" . ("∨"))
("And" . ("⋀")) ("Or" . ("⋁"))
("i" . ("∩")) ("un" . ("∪")) ("u+" . ("⊎")) ("u." . ("⊍"))
("I" . ("⋂")) ("Un" . ("⋃")) ("U+" . ("⨄")) ("U." . ("⨃"))
("glb" . ("⊓")) ("lub" . ("⊔"))
("Glb" . ("⨅")) ("Lub" . ("⨆"))
;; Entailment etc.
("entails" . ,(agda-input-to-string-list "⊢⊣⊤⊥⊦⊧⊨⊩⊪⊫⊬⊭⊮⊯"))
("|-" . ("⊢")) ("|-n" . ("⊬"))
("-|" . ("⊣"))
("|=" . ("⊨")) ("|=n" . ("⊭"))
("||-" . ("⊩")) ("||-n" . ("⊮"))
("||=" . ("⊫")) ("||=n" . ("⊯"))
("|||-" . ("⊪"))
;; Divisibility, parallelity.
("|" . ("∣")) ("|n" . ("∤"))
("||" . ("∥")) ("||n" . ("∦"))
;; Some symbols from logic and set theory.
("all" . ("∀"))
("ex" . ("∃"))
("exn" . ("∄"))
("0" . ("∅"))
("C" . ("∁"))
;; Corners, ceilings and floors.
("c" . ,(agda-input-to-string-list "⌜⌝⌞⌟⌈⌉⌊⌋"))
("cu" . ,(agda-input-to-string-list "⌜⌝ ⌈⌉ "))
("cl" . ,(agda-input-to-string-list " ⌞⌟ ⌊⌋"))
("cul" . ("⌜")) ("cuL" . ("⌈"))
("cur" . ("⌝")) ("cuR" . ("⌉"))
("cll" . ("⌞")) ("clL" . ("⌊"))
("clr" . ("⌟")) ("clR" . ("⌋"))
;; Various operators/symbols.
("qed" . ("∎"))
("x" . ("×"))
("o" . ("∘"))
("comp" . ("∘"))
("." . ("∙"))
("*" . ("⋆"))
(".+" . ("∔"))
(".-" . ("∸"))
(":" . ("∶"))
("::" . ("∷"))
("::-" . ("∺"))
("-:" . ("∹"))
("+ " . ("⊹"))
("surd3" . ("∛"))
("surd4" . ("∜"))
("increment" . ("∆"))
("inf" . ("∞"))
("&" . ("⅋"))
;; Circled operators.
("o+" . ("⊕"))
("o--" . ("⊖"))
("ox" . ("⊗"))
("o/" . ("⊘"))
("o." . ("⊙"))
("oo" . ("⊚"))
("o*" . ("⊛"))
("o=" . ("⊜"))
("o-" . ("⊝"))
("O+" . ("⨁"))
("Ox" . ("⨂"))
("O." . ("⨀"))
("O*" . ("⍟"))
;; Boxed operators.
("b+" . ("⊞"))
("b-" . ("⊟"))
("bx" . ("⊠"))
("b." . ("⊡"))
;; Various symbols.
("integral" . ,(agda-input-to-string-list "∫∬∭∮∯∰∱∲∳"))
("angle" . ,(agda-input-to-string-list "∟∡∢⊾⊿"))
("join" . ,(agda-input-to-string-list "⋈⋉⋊⋋⋌⨝⟕⟖⟗"))
;; Arrows.
("l" . ,(agda-input-to-string-list "←⇐⇚⇇⇆↤⇦↞↼↽⇠⇺↜⇽⟵⟸↚⇍⇷ ↹ ↢↩↫⇋⇜⇤⟻⟽⤆↶↺⟲ "))
("r" . ,(agda-input-to-string-list "→⇒⇛⇉⇄↦⇨↠⇀⇁⇢⇻↝⇾⟶⟹↛⇏⇸⇶ ↴ ↣↪↬⇌⇝⇥⟼⟾⤇↷↻⟳⇰⇴⟴⟿ ➵➸➙➔➛➜➝➞➟➠➡➢➣➤➧➨➩➪➫➬➭➮➯➱➲➳➺➻➼➽➾⊸"))
("u" . ,(agda-input-to-string-list "↑⇑⟰⇈⇅↥⇧↟↿↾⇡⇞ ↰↱➦ ⇪⇫⇬⇭⇮⇯ "))
("d" . ,(agda-input-to-string-list "↓⇓⟱⇊⇵↧⇩↡⇃⇂⇣⇟ ↵↲↳➥ ↯ "))
("ud" . ,(agda-input-to-string-list "↕⇕ ↨⇳ "))
("lr" . ,(agda-input-to-string-list "↔⇔ ⇼↭⇿⟷⟺↮⇎⇹ "))
("ul" . ,(agda-input-to-string-list "↖⇖ ⇱↸ "))
("ur" . ,(agda-input-to-string-list "↗⇗ ➶➹➚ "))
("dr" . ,(agda-input-to-string-list "↘⇘ ⇲ ➴➷➘ "))
("dl" . ,(agda-input-to-string-list "↙⇙ "))
("l-" . ("←")) ("<-" . ("←")) ("l=" . ("⇐"))
("r-" . ("→")) ("->" . ("→")) ("r=" . ("⇒")) ("=>" . ("⇒"))
("u-" . ("↑")) ("u=" . ("⇑"))
("d-" . ("↓")) ("d=" . ("⇓"))
("ud-" . ("↕")) ("ud=" . ("⇕"))
("lr-" . ("↔")) ("<->" . ("↔")) ("lr=" . ("⇔")) ("<=>" . ("⇔"))
("ul-" . ("↖")) ("ul=" . ("⇖"))
("ur-" . ("↗")) ("ur=" . ("⇗"))
("dr-" . ("↘")) ("dr=" . ("⇘"))
("dl-" . ("↙")) ("dl=" . ("⇙"))
("l==" . ("⇚")) ("l-2" . ("⇇")) ("l-r-" . ("⇆"))
("r==" . ("⇛")) ("r-2" . ("⇉")) ("r-3" . ("⇶")) ("r-l-" . ("⇄"))
("u==" . ("⟰")) ("u-2" . ("⇈")) ("u-d-" . ("⇅"))
("d==" . ("⟱")) ("d-2" . ("⇊")) ("d-u-" . ("⇵"))
("l--" . ("⟵")) ("<--" . ("⟵")) ("l~" . ("↜" "⇜"))
("r--" . ("⟶")) ("-->" . ("⟶")) ("r~" . ("↝" "⇝" "⟿"))
("lr--" . ("⟷")) ("<-->" . ("⟷")) ("lr~" . ("↭"))
("l-n" . ("↚")) ("<-n" . ("↚")) ("l=n" . ("⇍"))
("r-n" . ("↛")) ("->n" . ("↛")) ("r=n" . ("⇏")) ("=>n" . ("⇏"))
("lr-n" . ("↮")) ("<->n" . ("↮")) ("lr=n" . ("⇎")) ("<=>n" . ("⇎"))
("l-|" . ("↤")) ("ll-" . ("↞"))
("r-|" . ("↦")) ("rr-" . ("↠"))
("u-|" . ("↥")) ("uu-" . ("↟"))
("d-|" . ("↧")) ("dd-" . ("↡"))
("ud-|" . ("↨"))
("l->" . ("↢"))
("r->" . ("↣"))
("r-o" . ("⊸")) ("-o" . ("⊸"))
("dz" . ("↯"))
;; Ellipsis.
("..." . ,(agda-input-to-string-list "⋯⋮⋰⋱"))
;; Box-drawing characters.
("---" . ,(agda-input-to-string-list "─│┌┐└┘├┤┬┼┴╴╵╶╷╭╮╯╰╱╲╳"))
("--=" . ,(agda-input-to-string-list "═║╔╗╚╝╠╣╦╬╩ ╒╕╘╛╞╡╤╪╧ ╓╖╙╜╟╢╥╫╨"))
("--_" . ,(agda-input-to-string-list "━┃┏┓┗┛┣┫┳╋┻╸╹╺╻
┍┯┑┕┷┙┝┿┥┎┰┒┖┸┚┠╂┨┞╀┦┟╁┧┢╈┪┡╇┩
┮┭┶┵┾┽┲┱┺┹╊╉╆╅╄╃ ╿╽╼╾"))
("--." . ,(agda-input-to-string-list "╌╎┄┆┈┊
╍╏┅┇┉┋"))
;; Triangles.
;; Big/small, black/white.
("t" . ,(agda-input-to-string-list "◂◃◄◅▸▹►▻▴▵▾▿◢◿◣◺◤◸◥◹"))
("T" . ,(agda-input-to-string-list "◀◁▶▷▲△▼▽◬◭◮"))
("tb" . ,(agda-input-to-string-list "◂▸▴▾◄►◢◣◤◥"))
("tw" . ,(agda-input-to-string-list "◃▹▵▿◅▻◿◺◸◹"))
("Tb" . ,(agda-input-to-string-list "◀▶▲▼"))
("Tw" . ,(agda-input-to-string-list "◁▷△▽"))
;; Squares.
("sq" . ,(agda-input-to-string-list "■□◼◻◾◽▣▢▤▥▦▧▨▩◧◨◩◪◫◰◱◲◳"))
("sqb" . ,(agda-input-to-string-list "■◼◾"))
("sqw" . ,(agda-input-to-string-list "□◻◽"))
("sq." . ("▣"))
("sqo" . ("▢"))
;; Rectangles.
("re" . ,(agda-input-to-string-list "▬▭▮▯"))
("reb" . ,(agda-input-to-string-list "▬▮"))
("rew" . ,(agda-input-to-string-list "▭▯"))
;; Parallelograms.
("pa" . ,(agda-input-to-string-list "▰▱"))
("pab" . ("▰"))
("paw" . ("▱"))
;; Diamonds.
("di" . ,(agda-input-to-string-list "◆◇◈"))
("dib" . ("◆"))
("diw" . ("◇"))
("di." . ("◈"))
;; Circles.
("ci" . ,(agda-input-to-string-list "●○◎◌◯◍◐◑◒◓◔◕◖◗◠◡◴◵◶◷⚆⚇⚈⚉"))
("cib" . ("●"))
("ciw" . ("○"))
("ci." . ("◎"))
("ci.." . ("◌"))
("ciO" . ("◯"))
;; Stars.
("st" . ,(agda-input-to-string-list "⋆✦✧✶✴✹ ★☆✪✫✯✰✵✷✸"))
("st4" . ,(agda-input-to-string-list "✦✧"))
("st6" . ("✶"))
("st8" . ("✴"))
("st12" . ("✹"))
;; Blackboard bold letters.
("bn" . ("ℕ"))
("bz" . ("ℤ"))
("bq" . ("ℚ"))
("br" . ("ℝ"))
("bc" . ("ℂ"))
("bp" . ("ℙ"))
("bb" . ("𝔹"))
("bsum" . ("⅀"))
;; Blackboard bold numbers.
("b0" . ("𝟘"))
("b1" . ("𝟙"))
("b2" . ("𝟚"))
("b3" . ("𝟛"))
("b4" . ("𝟜"))
("b5" . ("𝟝"))
("b6" . ("𝟞"))
("b7" . ("𝟟"))
("b8" . ("𝟠"))
("b9" . ("𝟡"))
;; Parentheses.
("(" . ,(agda-input-to-string-list "([{⁅⁽₍〈⎴⟅⟦⟨⟪⦃〈《「『【〔〖〚︵︷︹︻︽︿﹁﹃﹙﹛﹝([{「"))
(")" . ,(agda-input-to-string-list ")]}⁆⁾₎〉⎵⟆⟧⟩⟫⦄〉》」』】〕〗〛︶︸︺︼︾﹀﹂﹄﹚﹜﹞)]}」"))
("[[" . ("⟦"))
("]]" . ("⟧"))
("<" . ("⟨"))
(">" . ("⟩"))
("<<" . ("⟪"))
(">>" . ("⟫"))
("{{" . ("⦃"))
("}}" . ("⦄"))
("(b" . ("⟅"))
(")b" . ("⟆"))
("lbag" . ("⟅"))
("rbag" . ("⟆"))
;; Primes.
("'" . ,(agda-input-to-string-list "′″‴⁗"))
("`" . ,(agda-input-to-string-list "‵‶‷"))
;; Fractions.
("frac" . ,(agda-input-to-string-list "¼½¾⅓⅔⅕⅖⅗⅘⅙⅚⅛⅜⅝⅞⅟"))
;; Bullets.
("bu" . ,(agda-input-to-string-list "•◦‣⁌⁍"))
("bub" . ("•"))
("buw" . ("◦"))
("but" . ("‣"))
;; Musical symbols.
("note" . ,(agda-input-to-string-list "♩♪♫♬"))
("b" . ("♭"))
("#" . ("♯"))
;; Other punctuation and symbols.
("\\" . ("\\"))
("en" . ("–"))
("em" . ("—"))
("^i" . ("ⁱ"))
("!!" . ("‼"))
("??" . ("⁇"))
("?!" . ("‽" "⁈"))
("!?" . ("⁉"))
("die" . ,(agda-input-to-string-list "⚀⚁⚂⚃⚄⚅"))
("asterisk" . ,(agda-input-to-string-list "⁎⁑⁂✢✣✤✥✱✲✳✺✻✼✽❃❉❊❋"))
("8<" . ("✂" "✄"))
("tie" . ("⁀"))
("undertie" . ("‿"))
("apl" . ,(agda-input-to-string-list "⌶⌷⌸⌹⌺⌻⌼⌽⌾⌿⍀⍁⍂⍃⍄⍅⍆⍇⍈
⍉⍊⍋⍌⍍⍎⍏⍐⍑⍒⍓⍔⍕⍖⍗⍘⍙⍚⍛
⍜⍝⍞⍟⍠⍡⍢⍣⍤⍥⍦⍧⍨⍩⍪⍫⍬⍭⍮
⍯⍰⍱⍲⍳⍴⍵⍶⍷⍸⍹⍺⎕"))
;; Some combining characters.
;;
;; The following combining characters also have (other)
;; translations:
;; ̀ ́ ̂ ̃ ̄ ̆ ̇ ̈ ̋ ̌ ̣ ̧ ̱
("^--" . ,(agda-input-to-string-list"̅̿"))
("_--" . ,(agda-input-to-string-list"̲̳"))
("^~" . ,(agda-input-to-string-list"̃͌"))
("_~" . ( "̰"))
("^." . ,(agda-input-to-string-list"̇̈⃛⃜"))
("_." . ,(agda-input-to-string-list"̣̤"))
("^l" . ,(agda-input-to-string-list"⃖⃐⃔"))
("^l-" . ( "⃖"))
("^r" . ,(agda-input-to-string-list"⃗⃑⃕"))
("^r-" . ( "⃗"))
("^lr" . ( "⃡"))
("_lr" . ( "͍"))
("^^" . ,(agda-input-to-string-list"̂̑͆"))
("_^" . ,(agda-input-to-string-list"̭̯̪"))
("^v" . ,(agda-input-to-string-list"̌̆"))
("_v" . ,(agda-input-to-string-list"̬̮̺"))
;; Shorter forms of many greek letters plus ƛ.
("Ga" . ("α")) ("GA" . ("Α"))
("Gb" . ("β")) ("GB" . ("Β"))
("Gg" . ("γ")) ("GG" . ("Γ"))
("Gd" . ("δ")) ("GD" . ("Δ"))
("Ge" . ("ε")) ("GE" . ("Ε"))
("Gz" . ("ζ")) ("GZ" . ("Ζ"))
;; \eta \Eta
("Gth" . ("θ")) ("GTH" . ("Θ"))
("Gi" . ("ι")) ("GI" . ("Ι"))
("Gk" . ("κ")) ("GK" . ("Κ"))
("Gl" . ("λ")) ("GL" . ("Λ")) ("Gl-" . ("ƛ"))
("Gm" . ("μ")) ("GM" . ("Μ"))
("Gn" . ("ν")) ("GN" . ("Ν"))
("Gx" . ("ξ")) ("GX" . ("Ξ"))
;; \omicron \Omicron
;; \pi \Pi
("Gr" . ("ρ")) ("GR" . ("Ρ"))
("Gs" . ("σ")) ("GS" . ("Σ"))
("Gt" . ("τ")) ("GT" . ("Τ"))
("Gu" . ("υ")) ("GU" . ("Υ"))
("Gf" . ("φ")) ("GF" . ("Φ"))
("Gc" . ("χ")) ("GC" . ("Χ"))
("Gp" . ("ψ")) ("GP" . ("Ψ"))
("Go" . ("ω")) ("GO" . ("Ω"))
;; Mathematical characters
("MiA" . ("𝐴"))
("MiB" . ("𝐵"))
("MiC" . ("𝐶"))
("MiD" . ("𝐷"))
("MiE" . ("𝐸"))
("MiF" . ("𝐹"))
("MiG" . ("𝐺"))
("MiH" . ("𝐻"))
("MiI" . ("𝐼"))
("MiJ" . ("𝐽"))
("MiK" . ("𝐾"))
("MiL" . ("𝐿"))
("MiM" . ("𝑀"))
("MiN" . ("𝑁"))
("MiO" . ("𝑂"))
("MiP" . ("𝑃"))
("MiQ" . ("𝑄"))
("MiR" . ("𝑅"))
("MiS" . ("𝑆"))
("MiT" . ("𝑇"))
("MiU" . ("𝑈"))
("MiV" . ("𝑉"))
("MiW" . ("𝑊"))
("MiX" . ("𝑋"))
("MiY" . ("𝑌"))
("MiZ" . ("𝑍"))
("Mia" . ("𝑎"))
("Mib" . ("𝑏"))
("Mic" . ("𝑐"))
("Mid" . ("𝑑"))
("Mie" . ("𝑒"))
("Mif" . ("𝑓"))
("Mig" . ("𝑔"))
("Mii" . ("𝑖"))
("Mij" . ("𝑗"))
("Mik" . ("𝑘"))
("Mil" . ("𝑙"))
("Mim" . ("𝑚"))
("Min" . ("𝑛"))
("Mio" . ("𝑜"))
("Mip" . ("𝑝"))
("Miq" . ("𝑞"))
("Mir" . ("𝑟"))
("Mis" . ("𝑠"))
("Mit" . ("𝑡"))
("Miu" . ("𝑢"))
("Miv" . ("𝑣"))
("Miw" . ("𝑤"))
("Mix" . ("𝑥"))
("Miy" . ("𝑦"))
("Miz" . ("𝑧"))
("MIA" . ("𝑨"))
("MIB" . ("𝑩"))
("MIC" . ("𝑪"))
("MID" . ("𝑫"))
("MIE" . ("𝑬"))
("MIF" . ("𝑭"))
("MIG" . ("𝑮"))
("MIH" . ("𝑯"))
("MII" . ("𝑰"))
("MIJ" . ("𝑱"))
("MIK" . ("𝑲"))
("MIL" . ("𝑳"))
("MIM" . ("𝑴"))
("MIN" . ("𝑵"))
("MIO" . ("𝑶"))
("MIP" . ("𝑷"))
("MIQ" . ("𝑸"))
("MIR" . ("𝑹"))
("MIS" . ("𝑺"))
("MIT" . ("𝑻"))
("MIU" . ("𝑼"))
("MIV" . ("𝑽"))
("MIW" . ("𝑾"))
("MIX" . ("𝑿"))
("MIY" . ("𝒀"))
("MIZ" . ("𝒁"))
("MIa" . ("𝒂"))
("MIb" . ("𝒃"))
("MIc" . ("𝒄"))
("MId" . ("𝒅"))
("MIe" . ("𝒆"))
("MIf" . ("𝒇"))
("MIg" . ("𝒈"))
("MIh" . ("𝒉"))
("MIi" . ("𝒊"))
("MIj" . ("𝒋"))
("MIk" . ("𝒌"))
("MIl" . ("𝒍"))
("MIm" . ("𝒎"))
("MIn" . ("𝒏"))
("MIo" . ("𝒐"))
("MIp" . ("𝒑"))
("MIq" . ("𝒒"))
("MIr" . ("𝒓"))
("MIs" . ("𝒔"))
("MIt" . ("𝒕"))
("MIu" . ("𝒖"))
("MIv" . ("𝒗"))
("MIw" . ("𝒘"))
("MIx" . ("𝒙"))
("MIy" . ("𝒚"))
("MIz" . ("𝒛"))
("McA" . ("𝒜"))
("McC" . ("𝒞"))
("McD" . ("𝒟"))
("McG" . ("𝒢"))
("McJ" . ("𝒥"))
("McK" . ("𝒦"))
("McN" . ("𝒩"))
("McO" . ("𝒪"))
("McP" . ("𝒫"))
("McQ" . ("𝒬"))
("McS" . ("𝒮"))
("McT" . ("𝒯"))
("McU" . ("𝒰"))
("McV" . ("𝒱"))
("McW" . ("𝒲"))
("McX" . ("𝒳"))
("McY" . ("𝒴"))
("McZ" . ("𝒵"))
("Mca" . ("𝒶"))
("Mcb" . ("𝒷"))
("Mcc" . ("𝒸"))
("Mcd" . ("𝒹"))
("Mcf" . ("𝒻"))
("Mch" . ("𝒽"))
("Mci" . ("𝒾"))
("Mcj" . ("𝒿"))
("Mck" . ("𝓀"))
("Mcl" . ("𝓁"))
("Mcm" . ("𝓂"))
("Mcn" . ("𝓃"))
("Mcp" . ("𝓅"))
("Mcq" . ("𝓆"))
("Mcr" . ("𝓇"))
("Mcs" . ("𝓈"))
("Mct" . ("𝓉"))
("Mcu" . ("𝓊"))
("Mcv" . ("𝓋"))
("Mcw" . ("𝓌"))
("Mcx" . ("𝓍"))
("Mcy" . ("𝓎"))
("Mcz" . ("𝓏"))
("MCA" . ("𝓐"))
("MCB" . ("𝓑"))
("MCC" . ("𝓒"))
("MCD" . ("𝓓"))
("MCE" . ("𝓔"))
("MCF" . ("𝓕"))
("MCG" . ("𝓖"))
("MCH" . ("𝓗"))
("MCI" . ("𝓘"))
("MCJ" . ("𝓙"))
("MCK" . ("𝓚"))
("MCL" . ("𝓛"))
("MCM" . ("𝓜"))
("MCN" . ("𝓝"))
("MCO" . ("𝓞"))
("MCP" . ("𝓟"))
("MCQ" . ("𝓠"))
("MCR" . ("𝓡"))
("MCS" . ("𝓢"))
("MCT" . ("𝓣"))
("MCU" . ("𝓤"))
("MCV" . ("𝓥"))
("MCW" . ("𝓦"))
("MCX" . ("𝓧"))
("MCY" . ("𝓨"))
("MCZ" . ("𝓩"))
("MCa" . ("𝓪"))
("MCb" . ("𝓫"))
("MCc" . ("𝓬"))
("MCd" . ("𝓭"))
("MCe" . ("𝓮"))
("MCf" . ("𝓯"))
("MCg" . ("𝓰"))
("MCh" . ("𝓱"))
("MCi" . ("𝓲"))
("MCj" . ("𝓳"))
("MCk" . ("𝓴"))
("MCl" . ("𝓵"))
("MCm" . ("𝓶"))
("MCn" . ("𝓷"))
("MCo" . ("𝓸"))
("MCp" . ("𝓹"))
("MCq" . ("𝓺"))
("MCr" . ("𝓻"))
("MCs" . ("𝓼"))
("MCt" . ("𝓽"))
("MCu" . ("𝓾"))
("MCv" . ("𝓿"))
("MCw" . ("𝔀"))
("MCx" . ("𝔁"))
("MCy" . ("𝔂"))
("MCz" . ("𝔃"))
("MfA" . ("𝔄"))
("MfB" . ("𝔅"))
("MfD" . ("𝔇"))
("MfE" . ("𝔈"))
("MfF" . ("𝔉"))
("MfG" . ("𝔊"))
("MfJ" . ("𝔍"))
("MfK" . ("𝔎"))
("MfL" . ("𝔏"))
("MfM" . ("𝔐"))
("MfN" . ("𝔑"))
("MfO" . ("𝔒"))
("MfP" . ("𝔓"))
("MfQ" . ("𝔔"))
("MfS" . ("𝔖"))
("MfT" . ("𝔗"))
("MfU" . ("𝔘"))
("MfV" . ("𝔙"))
("MfW" . ("𝔚"))
("MfX" . ("𝔛"))
("MfY" . ("𝔜"))
("Mfa" . ("𝔞"))
("Mfb" . ("𝔟"))
("Mfc" . ("𝔠"))
("Mfd" . ("𝔡"))
("Mfe" . ("𝔢"))
("Mff" . ("𝔣"))
("Mfg" . ("𝔤"))
("Mfh" . ("𝔥"))
("Mfi" . ("𝔦"))
("Mfj" . ("𝔧"))
("Mfk" . ("𝔨"))
("Mfl" . ("𝔩"))
("Mfm" . ("𝔪"))
("Mfn" . ("𝔫"))
("Mfo" . ("𝔬"))
("Mfp" . ("𝔭"))
("Mfq" . ("𝔮"))
("Mfr" . ("𝔯"))
("Mfs" . ("𝔰"))
("Mft" . ("𝔱"))
("Mfu" . ("𝔲"))
("Mfv" . ("𝔳"))
("Mfw" . ("𝔴"))
("Mfx" . ("𝔵"))
("Mfy" . ("𝔶"))
("Mfz" . ("𝔷"))
;; (Sub / Super) scripts
("_a" . ("ₐ"))
("_e" . ("ₑ"))
("_h" . ("ₕ"))
("_i" . ("ᵢ"))
("_j" . ("ⱼ"))
("_k" . ("ₖ"))
("_l" . ("ₗ"))
("_m" . ("ₘ"))
("_n" . ("ₙ"))
("_o" . ("ₒ"))
("_p" . ("ₚ"))
("_r" . ("ᵣ"))
("_s" . ("ₛ"))
("_t" . ("ₜ"))
("_u" . ("ᵤ"))
("_v" . ("ᵥ"))
("_x" . ("ₓ"))
("^a" . ("ᵃ"))
("^b" . ("ᵇ"))
("^c" . ("ᶜ"))
("^d" . ("ᵈ"))
("^e" . ("ᵉ"))
("^f" . ("ᶠ"))
("^g" . ("ᵍ"))
("^h" . ("ʰ"))
("^i" . ("ⁱ"))
("^j" . ("ʲ"))
("^k" . ("ᵏ"))
("^l" . ("ˡ"))
("^m" . ("ᵐ"))
("^n" . ("ⁿ"))
("^o" . ("ᵒ"))
("^p" . ("ᵖ"))
("^r" . ("ʳ"))
("^s" . ("ˢ"))
("^t" . ("ᵗ"))
("^u" . ("ᵘ"))
("^v" . ("ᵛ"))
("^w" . ("ʷ"))
("^x" . ("ˣ"))
("^y" . ("ʸ"))
("^z" . ("ᶻ"))
("^A" . ("ᴬ"))
("^B" . ("ᴮ"))
("^D" . ("ᴰ"))
("^E" . ("ᴱ"))
("^G" . ("ᴳ"))
("^H" . ("ᴴ"))
("^I" . ("ᴵ"))
("^J" . ("ᴶ"))
("^K" . ("ᴷ"))
("^L" . ("ᴸ"))
("^M" . ("ᴹ"))
("^N" . ("ᴺ"))
("^O" . ("ᴼ"))
("^P" . ("ᴾ"))
("^R" . ("ᴿ"))
("^T" . ("ᵀ"))
("^U" . ("ᵁ"))
("^V" . ("ⱽ"))
("^W" . ("ᵂ"))
;; Some ISO8859-1 characters.
(" " . (" "))
("!" . ("¡"))
("cent" . ("¢"))
("brokenbar" . ("¦"))
("degree" . ("°"))
("?" . ("¿"))
("^a_" . ("ª"))
("^o_" . ("º"))
;; Circled, parenthesised etc. numbers and letters.
( "(0)" . ,(agda-input-to-string-list " ⓪"))
( "(1)" . ,(agda-input-to-string-list "⑴①⒈❶➀➊"))
( "(2)" . ,(agda-input-to-string-list "⑵②⒉❷➁➋"))
( "(3)" . ,(agda-input-to-string-list "⑶③⒊❸➂➌"))
( "(4)" . ,(agda-input-to-string-list "⑷④⒋❹➃➍"))
( "(5)" . ,(agda-input-to-string-list "⑸⑤⒌❺➄➎"))
( "(6)" . ,(agda-input-to-string-list "⑹⑥⒍❻➅➏"))
( "(7)" . ,(agda-input-to-string-list "⑺⑦⒎❼➆➐"))
( "(8)" . ,(agda-input-to-string-list "⑻⑧⒏❽➇➑"))
( "(9)" . ,(agda-input-to-string-list "⑼⑨⒐❾➈➒"))
("(10)" . ,(agda-input-to-string-list "⑽⑩⒑❿➉➓"))
("(11)" . ,(agda-input-to-string-list "⑾⑪⒒"))
("(12)" . ,(agda-input-to-string-list "⑿⑫⒓"))
("(13)" . ,(agda-input-to-string-list "⒀⑬⒔"))
("(14)" . ,(agda-input-to-string-list "⒁⑭⒕"))
("(15)" . ,(agda-input-to-string-list "⒂⑮⒖"))
("(16)" . ,(agda-input-to-string-list "⒃⑯⒗"))
("(17)" . ,(agda-input-to-string-list "⒄⑰⒘"))
("(18)" . ,(agda-input-to-string-list "⒅⑱⒙"))
("(19)" . ,(agda-input-to-string-list "⒆⑲⒚"))
("(20)" . ,(agda-input-to-string-list "⒇⑳⒛"))
("(a)" . ,(agda-input-to-string-list "⒜Ⓐⓐ"))
("(b)" . ,(agda-input-to-string-list "⒝Ⓑⓑ"))
("(c)" . ,(agda-input-to-string-list "⒞Ⓒⓒ"))
("(d)" . ,(agda-input-to-string-list "⒟Ⓓⓓ"))
("(e)" . ,(agda-input-to-string-list "⒠Ⓔⓔ"))
("(f)" . ,(agda-input-to-string-list "⒡Ⓕⓕ"))
("(g)" . ,(agda-input-to-string-list "⒢Ⓖⓖ"))
("(h)" . ,(agda-input-to-string-list "⒣Ⓗⓗ"))
("(i)" . ,(agda-input-to-string-list "⒤Ⓘⓘ"))
("(j)" . ,(agda-input-to-string-list "⒥Ⓙⓙ"))
("(k)" . ,(agda-input-to-string-list "⒦Ⓚⓚ"))
("(l)" . ,(agda-input-to-string-list "⒧Ⓛⓛ"))
("(m)" . ,(agda-input-to-string-list "⒨Ⓜⓜ"))
("(n)" . ,(agda-input-to-string-list "⒩Ⓝⓝ"))
("(o)" . ,(agda-input-to-string-list "⒪Ⓞⓞ"))
("(p)" . ,(agda-input-to-string-list "⒫Ⓟⓟ"))
("(q)" . ,(agda-input-to-string-list "⒬Ⓠⓠ"))
("(r)" . ,(agda-input-to-string-list "⒭Ⓡⓡ"))
("(s)" . ,(agda-input-to-string-list "⒮Ⓢⓢ"))
("(t)" . ,(agda-input-to-string-list "⒯Ⓣⓣ"))
("(u)" . ,(agda-input-to-string-list "⒰Ⓤⓤ"))
("(v)" . ,(agda-input-to-string-list "⒱Ⓥⓥ"))
("(w)" . ,(agda-input-to-string-list "⒲Ⓦⓦ"))
("(x)" . ,(agda-input-to-string-list "⒳Ⓧⓧ"))
("(y)" . ,(agda-input-to-string-list "⒴Ⓨⓨ"))
("(z)" . ,(agda-input-to-string-list "⒵Ⓩⓩ"))
))
"A list of translations specific to the Agda input method.
Each element is a pair (KEY-SEQUENCE-STRING . LIST-OF-TRANSLATION-STRINGS).
All the translation strings are possible translations
of the given key sequence; if there is more than one you can choose
between them using the arrow keys.
Note that if you customize this setting you will not
automatically benefit (or suffer) from modifications to its
default value when the library is updated. If you just want to
add some bindings it is probably a better idea to customize
`agda-input-user-translations'.
These translation pairs are included after those in
`agda-input-user-translations', but before the ones inherited
from other input methods (see `agda-input-inherit').
If you change this setting manually (without using the
customization buffer) you need to call `agda-input-setup' in
order for the change to take effect."
:group 'agda-input
:set 'agda-input-incorporate-changed-setting
:initialize 'custom-initialize-default
:type '(repeat (cons (string :tag "Key sequence")
(repeat :tag "Translations" string))))
(defcustom agda-input-user-translations nil
"Like `agda-input-translations', but more suitable for user
customizations since by default it is empty.
These translation pairs are included first, before those in
`agda-input-translations' and the ones inherited from other input
methods."
:group 'agda-input
:set 'agda-input-incorporate-changed-setting
:initialize 'custom-initialize-default
:type '(repeat (cons (string :tag "Key sequence")
(repeat :tag "Translations" string))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Inspecting and modifying translation maps
(defun agda-input-get-translations (qp)
"Return a list containing all translations from the Quail
package QP (except for those corresponding to ASCII).
Each pair in the list has the form (KEY-SEQUENCE . TRANSLATION)."
(with-temp-buffer
(activate-input-method qp) ; To make sure that the package is loaded.
(unless (quail-package qp)
(error "%s is not a Quail package." qp))
(let ((decode-map (list 'decode-map)))
(quail-build-decode-map (list (quail-map)) "" decode-map 0)
(cdr decode-map))))
(defun agda-input-show-translations (qp)
"Display all translations used by the Quail package QP (a string).
\(Except for those corresponding to ASCII)."
(interactive (list (read-input-method-name
"Quail input method (default %s): " "Agda")))
(let ((buf (concat "*" qp " input method translations*")))
(with-output-to-temp-buffer buf
(with-current-buffer buf
(quail-insert-decode-map
(cons 'decode-map (agda-input-get-translations qp)))))))
(defun agda-input-add-translations (trans)
"Add the given translations TRANS to the Agda input method.
TRANS is a list of pairs (KEY-SEQUENCE . TRANSLATION). The
translations are appended to the current translations."
(with-temp-buffer
(dolist (tr (agda-input-concat-map (eval agda-input-tweak-all) trans))
(quail-defrule (car tr) (cdr tr) "Agda" t))))
(defun agda-input-inherit-package (qp &optional fun)
"Let the Agda input method inherit the translations from the
Quail package QP (except for those corresponding to ASCII).
The optional function FUN can be used to modify the translations.
It is given a pair (KEY-SEQUENCE . TRANSLATION) and should return
a list of such pairs."
(let ((trans (agda-input-get-translations qp)))
(agda-input-add-translations
(if fun (agda-input-concat-map fun trans)
trans))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Setting up the input method
(defun agda-input-setup ()
"Set up the Agda input method based on the customisable
variables and underlying input methods."
;; Create (or reset) the input method.
(with-temp-buffer
(quail-define-package "Agda" "UTF-8" "∏" t ; guidance
"Agda input method.
The purpose of this input method is to edit Agda programs, but
since it is highly customisable it can be made useful for other
tasks as well."
nil nil nil nil nil nil t ; maximum-shortest
))
(agda-input-add-translations
(mapcar (lambda (tr) (cons (car tr) (vconcat (cdr tr))))
(append agda-input-user-translations
agda-input-translations)))
(dolist (def agda-input-inherit)
(agda-input-inherit-package (car def)
(eval (cdr def)))))
(defun agda-input-incorporate-changed-setting (sym val)
"Update the Agda input method based on the customisable
variables and underlying input methods.
Suitable for use in the :set field of `defcustom'."
(set-default sym val)
(agda-input-setup))
;; Set up the input method.
(agda-input-setup)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Administrative details
(provide 'agda-input)
;;; agda-input.el ends here
|