-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjpt-apl-mode.elc
66 lines (58 loc) · 9.3 KB
/
jpt-apl-mode.elc
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
;ELC
;;; Compiled
;;; in Emacs version 29.0.60
;;; with all optimizations.
(require 'anaphora)
(defvar jpt-apl-exclude-plist (list :ascii '(43 45 33 63 61 126 124 47 92 44 46 64 38) :dyalog '(8801 8802 9054 9014 38) :gnu '(9081 9078)) nil)
(byte-code "\300\301!\210\300\302\303\304\"!\210\305\306\307\310\311\312\313\314\315\316& \210\317\320\321\322\323\324%\210\317\325\326\327\323\330%\210\317\331\307\332\323\324%\207" [make-variable-buffer-local jpt-apl-exclude-plist defvar-1 jpt-apl-data ((8592 "assign" 60 45) (8594 "branch" 45 62) (43 "conjugate/plus") (45 "negate/minus") (215 "direction/times" 120 120) (247 "reciprocal/divide" 58 45) (9055 "ln/log" 42 111) (33 "factorial/binominal") (63 "roll/deal") (9017 "matrix inverse/matrix divide" 91 45) (9675 "pi times/circular" 79 79) (124 "magnitude/reidue") (8968 "ceiling/maximum" 55 55) (8970 "floor/minimum" 108 108) (8869 "decode" 124 95) (8868 "encode" 84 84) (8867 "same/left" 45 124) (8866 "same/right" 124 45) (61 "equal") (8800 "unique mask/not equal" 61 47) (8804 "less or equal to" 60 61) (8805 "greater or equal to" 62 61) (8801 "depht/match" 61 61) (8802 "tally/not match" 55 61) (8744 "Greatest common divisor/or" 118 118) (8743 "lowest common multiple/and" 94 94) (9073 "nand" 118 126) (9074 "nor" 94 126) (8593 "mix/take" 94 124) (8595 "split/drop" 118 124) (8834 "enclose/partial enclose" 40 40) (8835 "first/pick" 41 41) (8838 "nest/partition" 40 95) (9015 "index" 124 93) (9035 "grade up" 65 124) (9042 "grade down" 86 124) (9075 "indices/indices of" 105 105) (9080 "where/where index" 105 95) (8714 "enlist/member of" 101 101) (9079 "find" 101 95) (8746 "unique/union" 117 117) (8745 "intersection" 110 110) (126 "not/without") (47 "replicate/reduce") (92 "expand/scan") (9023 "replicate first/reduce first" 47 45) (9024 "expand first/scan first" 92 45) (44 "ravel/catinate/laminate") (9066 "table/catenate first" 44 45) (9076 "shape/reshape" 112 112) (9021 "reverse/rotate" 79 124) (8854 "reverse first/rotate first" 79 45) (9033 "transpose/reorder axis" 79 92) (168 "each" 58 58) (9064 "constant/self/swap" 126 58) (9059 "repeat" 42 58) (46 "outer product (.∘)/inner product") (8728 ".∘ outer product & ∘ curry/compose" 111 111) (9060 "rank/atop" 111 58) (246 "over" 79 58) (64 "at") (9054 "Character input/output" 91 39) (9109 "systen name " 91 93) (9056 "variant" 91 58) (9016 "index key/key" 91 61) (9018 "stencil" 91 60) (9014 "I-beam" 84 95) (9674 "statement seperator" 60 62) (9053 "comment" 111 110) (9077 "right argument/right operand" 119 119) (9081 "values as OP" 119 95) (9082 "left argument/left operand" 97 97) (9078 "values as OP" 97 95) (8711 "recursion" 118 45) (38 "spawn") (175 "negative" 45 45) (9068 "empty numeric vector" 48 126)) custom-declare-group jpt-apl-header nil "APL: toolbar support." :group jpt-apl :link (emacs-commentary-link :tab "Commentary" "jpt-apl-mode.el") :prefix "jpt-apl-" custom-declare-variable jpt-apl-use-header t "Non-nil means APL should display the header" :type boolean jpt-apl-exclude '(:ascii :dyalog) "Determines which apl characters are displayed in the header.\nThe default is to exclude ASCII characters and those that are used\nby Dyalog but not april.\nNil allows all APL characters. Options: :ascii :dyalog :gnu" list jpt-apl-mode-global "non-nil means the apl header and key cords are available in all Emacs buffers.\nOthewise they are available only only in lisp buffers and at the repl\nFor beginners it is probaly better to leave it at nil"] 10)
(defvar jpt-apl-mode-hook nil)#@39 Stores alist of (keycord . code) maps
(defvar jpt-apl-cord-map nil (#$ . 3537))
(make-variable-buffer-local 'jpt-apl-cord-map)
(defvar jpt-apl-used-data "jtp-apl-data, but filtered to remove entries spesified by jpt-apl-exclude." nil)
(make-variable-buffer-local 'jpt-apl-used-data)#@66 Used in jpt-apl-maybe-header to toggle apl header bar on and off
(defvar jpt-apl-insert-header t (#$ . 3825))
(make-variable-buffer-local 'jpt-apl-insert-header)
(defalias 'get-code #[(data) "@\207" [data] 1])
(defalias 'get-help-string #[(data) "G\306U\203R \211G\306U\203 \211A\242\202 \307\310\311 GD\" \211A\242 \211A\242 \242\312\313\"\314\315\n@A@\204F \316\202J A@\f\317&.\207\211G\320U\203f \211A\242\202n \307\310\321GD\"\242\312\313\"\314\322\n@A@\204\212 \316\202\216 A@$,\207" [data #1=#:--cl-rest-- code help-string key1 key2 4 signal wrong-number-of-arguments (code help-string key1 key2) string-split "/" format "%c\n%s\n%s\n%c %c %s" "" "tab" 2 (code help-string) "%c\n%s\n%s\n" help-list #2=#:--cl-rest--] 9])
(defalias 'buttonize-entry #[(entry) "\302\303\304!!\305\304!\306!$\307\310 G\311\312 %\210 )\207" [entry button buttonize char-to-string get-code #[(data) "\301!\207" [data insert-char] 2] get-help-string add-face-text-property 0 (:underline nil) nil] 6])#@413 Returns a string of text-buttons. Each button is a APL character.
For each button:
Left mouse click inserts character at the cursor in the file.
Mouseover shows the key explanation in the form:
- APL character
- monadic meaning
- dyadic meaning
- keystroke
Keystroke are a triplet of characters two ASCII and a tab that generate the
APL character. The kestroke can always be entered instead of clicking the key.
(defalias 'jpt-apl-make-header #[nil "\304 \n\203 \n@\305B\306!B\nA)\202 )\237)\207" [button-list jpt-apl-used-data #1=#:tail entry nil " " buttonize-entry] 2 (#$ . 4868)])
(defalias 'jpt-apl-insert-header #[nil "\301\300!\210\302 \211\207" [header-line-format make-local-variable jpt-apl-make-header] 2])
(defalias 'jpt-apl-remove-header #[nil "\301\211\207" [header-line-format nil] 2])#@115 When jpt-apl-use-header is set display header.
Toggle it on/off in sync with the enable/disable cycle of the mode
(defalias 'jpt-apl-maybe-header #[nil "\203 \203 \302\300!\210\303\211\207\300 \207\302\300!\210\304\305 \207" [jpt-apl-insert-header jpt-apl-use-header make-local-variable t nil jpt-apl-remove-header] 2 (#$ . 5689)])
(defalias 'jpt-apl-make-cord-map #[(data) " \205T @\211G\306U\203M \n\211G\306U\203! \211A\242\202( \307\310\311GD\"\211A\242\211A\242\n\242\nCCP\211\f\fBB. A)\202 )\207" [data #1=#:tail entry #2=#:--cl-rest-- u _ 4 signal wrong-number-of-arguments (u _ c1 c2) c1 c2 cord jpt-apl-cord-map] 5])
(defalias 'jpt-apl-match-keycord #[nil "\212`Sf\305u\206 `Sf\211CCP+\306\n\"A\211\205&