[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: APL mode
From: |
Rustom Mody |
Subject: |
Re: APL mode |
Date: |
Mon, 14 Oct 2013 12:15:37 +0530 |
Ive made the earlier code standalone-executable (without rest of
apl.el) and more readable.
Once the following code is executed, f8 and f9 should work as prefixes
for entering Apl characters, irrespective of mode.
----------------------------------------
;; Following 2 lines needed for the rest to work
;; Assumed defined elsewhere (apl.el)
(defvar apl-mode-map (make-sparse-keymap))
(use-local-map apl-mode-map)
;; Data Structure representing keyboard with APL layout
;; Keys separated from its neighbour by a ¶
;; Each key is a triplet of 3 characters:
;; 1st is the usual key as seen on a normal keyboard
;; 2nd and 3rd are APL specific variants
(setq apl-keyboard '(
;; top (number) row
"`◊⍨¶1¨¡¶2¯€¶3<£¶4≤⍧¶5= ¶6≥ ¶7> ¶8≠⍂¶9∨⍱¶0∧⍲¶-×≡¶=÷⌹"
;; qwertyuiop row
"q?¿¶w⍵⌽¶e∈⍷¶r⍴ ¶t∼⍉¶y↑¥¶u↓ ¶i⍳⍸¶o○⍥¶p⋆⍟¶[← ¶]→ "
;; asdfghjkl row
"a⍺⊖¶s⌈ ¶d⌊ ¶f_⍫¶g∇⍒¶h∆⍋¶j∘⍤¶k'⌺¶l⎕⍞¶;⊢ ¶'⊣ "
;; zxcvbnm row
"z⊂ ¶x⊃ ¶c∩⍝¶v∪ ¶b⊥⍎¶n⊤⍕¶m|⌶¶,⌷⍪¶.⍎⍙¶/⍕⌿"
))
(setq apl-map1 (make-sparse-keymap))
(define-key apl-mode-map (kbd "<f8>") apl-map1)
(setq apl-map2 (make-sparse-keymap))
(define-key apl-mode-map (kbd "<f9>") apl-map2)
(dolist (line apl-keyboard)
(dolist (key (split-string line "¶"))
(let ((kb-key (string (aref key 0)))
(apl-key1 (string (aref key 1)))
(apl-key2 (string (aref key 2))))
(define-key apl-map1 kb-key apl-key1)
(define-key apl-map2 kb-key apl-key2)))
)
- Re: APL mode, (continued)
- Re: APL mode, Rustom Mody, 2013/10/13
- Re: APL mode, Stephen J. Turnbull, 2013/10/13
- Re: APL mode, Rustom Mody, 2013/10/13
- Re: APL mode, Stephen J. Turnbull, 2013/10/13
- Re: APL mode, Ivan Andrus, 2013/10/13
- Re: APL mode, Stefan Monnier, 2013/10/15
Re: APL mode, Rüdiger Sonderfeld, 2013/10/13
- Re: APL mode, Rustom Mody, 2013/10/13
- Re: APL mode, Xue Fuqiao, 2013/10/14
- Re: APL mode, Rustom Mody, 2013/10/14
- Re: APL mode, David De La Harpe Golden, 2013/10/17
- Re: APL mode, Stefan Monnier, 2013/10/17
- Re: APL mode, Rustom Mody, 2013/10/20
- Re: APL mode, Xue Fuqiao, 2013/10/21
- Re: APL mode, Stefan Monnier, 2013/10/21
- Re: APL mode, Rustom Mody, 2013/10/25
- Re: APL mode, Stefan Monnier, 2013/10/25