emacs-devel
[Top][All Lists]
Advanced

[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 10:30:42 +0530

On Sun, Oct 13, 2013 at 8:54 PM, Rüdiger Sonderfeld
<address@hidden> wrote:
> Hi,
>
> On Sunday 13 October 2013 20:17:04 Rustom Mody wrote:
>> I have one general question for you: Did you try Gnu-Apl under emacs?
>> I personally find the xmodmap approach too invasive to be practicable
>> -- everything other than the emacs-apl modes stop working!  Not just
>> at the emacs level but even at the X level eg Alt-F2, Alt-F4 etc etc
>> So I feel we need to find an input-method approach which does not
>> disturb things too much outside the 2 buffers where its needed -- Apl
>> file, Apl interpreter.
>
> so far I only tried GNU APL with inferior-apl-mode.  Change `inferior-apl-
> program' to point to the GNU APL executable and start `inferior-apl'.
>
> I agree that the xmodmap approach isn't very practical.

Heres a first cut attempt.
F8 and F9 are made to be like dead-keys by making them emacs prefix keys.
What do you think?

------------------------
;; (defvar apl-mode-map (make-sparse-keymap)) ;; defined elsewhere

(setq f9map (make-sparse-keymap))
(define-key apl-mode-map (kbd "<f9>") f9map)
(setq f8map (make-sparse-keymap))
(define-key apl-mode-map (kbd "<f8>") f8map)

(setq apl-key-table '(

;; top (number) row
"`◊⍨" "1¨¡" "2¯€" "3<£" "4≤⍧" "5= " "6≥ " "7> " "8≠⍂" "9∨⍱" "0∧⍲" "-×≡" "=÷⌹"

;; qwert row
"q?¿" "w⍵⌽" "e∈⍷" "r⍴ " "t∼⍉" "y↑¥" "u↓ " "i⍳⍸" "o○⍥" "p⋆⍟" "[← " "]→ "

;; asdf row
"a⍺⊖" "s⌈ " "d⌊ " "f_⍫" "g∇⍒" "h∆⍋" "j∘⍤" "k'⌺" "l⎕⍞" ";⊢ " "'⊣ "

;; zxcv row
"z⊂ " "x⊃ " "c∩⍝" "v∪ " "b⊥⍎" "n⊤⍕" "m|⌶" ",⌷⍪" ".⍎⍙" "/⍕⌿"

))

(dolist (k apl-key-table)
  (let ((kb-key   (string (aref k 0)))
    (apl-key1 (string (aref k 1)))
    (apl-key2 (string (aref k 2))))
  (define-key f8map kb-key apl-key1)
  (define-key f9map kb-key apl-key2)))
-----------------------------------------------------------
This is the 'ASCII-art though not ASCII' picture from gnu-apl that I have copied

╔════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦═════════╗
║ ~⍨ ║ !¡ ║ @€ ║ #£ ║ $⍧ ║ %  ║ ^  ║ &  ║ *⍂ ║ (⍱ ║ )⍲ ║ _≡ ║ +⌹ ║         ║
║ `◊ ║ 1¨ ║ 2¯ ║ 3< ║ 4≤ ║ 5= ║ 6≥ ║ 7> ║ 8≠ ║ 9∨ ║ 0∧ ║ -× ║ =÷ ║ BACKSP  ║
╠════╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦═╩══╦══════╣
║       ║ Q¿ ║ W⌽ ║ E⍷ ║ R  ║ T⍉ ║ Y¥ ║ U  ║ I⍸ ║ O⍥ ║ P⍟ ║ {  ║ }  ║  |⍀  ║
║  TAB  ║ q? ║ w⍵ ║ e∈ ║ r⍴ ║ t∼ ║ y↑ ║ u↓ ║ i⍳ ║ o○ ║ p⋆ ║ [← ║ ]→ ║  \⍝  ║
╠═══════╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩═╦══╩══════╣
║ (CAPS   ║ A⊖ ║ S  ║ D  ║ F⍫ ║ G⍒ ║ H⍋ ║ J⍤ ║ K⌺ ║ L⍞ ║ :  ║ "  ║         ║
║  LOCK)  ║ a⍺ ║ s⌈ ║ d⌊ ║ f_ ║ g∇ ║ h∆ ║ j∘ ║ k' ║ l⎕ ║ ;⊢ ║ '⊣ ║ RETURN  ║
╠═════════╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═══╦╩═════════╣
║             ║ Z  ║ X  ║ C⍝ ║ V  ║ B⍎ ║ N⍕ ║ M⌶ ║ <⍪ ║ >⍙ ║ ?⌿ ║          ║
║  SHIFT      ║ z⊂ ║ x⊃ ║ c∩ ║ v∪ ║ b⊥ ║ n⊤ ║ m| ║ ,⌷ ║ .⍎ ║ /⍕ ║  SHIFT   ║
╚═════════════╩════╩════╩════╩════╩════╩════╩════╩════╩════╩════╩══════════╝

reply via email to

[Prev in Thread] Current Thread [Next in Thread]