unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Rustom Mody <rustompmody@gmail.com>
To: "Rüdiger Sonderfeld" <ruediger@c-plusplus.de>
Cc: emacs-devel@gnu.org
Subject: Re: APL mode
Date: Mon, 14 Oct 2013 10:30:42 +0530	[thread overview]
Message-ID: <CAJ+TeoeZ+B+_xEcMt+aTwkEj6ZAyB+UmeXQQozAdTHtCGZmn+w@mail.gmail.com> (raw)
In-Reply-To: <2175241.EV4ttzPlpJ@descartes>

On Sun, Oct 13, 2013 at 8:54 PM, Rüdiger Sonderfeld
<ruediger@c-plusplus.de> 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	other threads:[~2013-10-14  5:00 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-12  4:48 APL mode Rustom Mody
2013-10-12  7:25 ` Thien-Thi Nguyen
2013-10-12 14:26 ` Stefan Monnier
2013-10-12 16:09   ` Rustom Mody
2013-10-12 19:08     ` Stefan Monnier
2013-10-13  6:45     ` Stephen J. Turnbull
2013-10-13  6:59       ` Rustom Mody
2013-10-13 11:10         ` Stephen J. Turnbull
2013-10-13 14:04           ` Rustom Mody
2013-10-13 15:35             ` Stephen J. Turnbull
2013-10-13 16:11             ` Ivan Andrus
2013-10-13 12:42 ` Rüdiger Sonderfeld
2013-10-13 14:47   ` Rustom Mody
2013-10-13 15:24     ` Rüdiger Sonderfeld
2013-10-14  5:00       ` Rustom Mody [this message]
2013-10-14  6:45         ` Rustom Mody
2013-10-14 13:34           ` Stefan Monnier
2013-10-14  8:21         ` Xue Fuqiao
2013-10-14 11:08           ` Rustom Mody
2013-10-17 18:54             ` David De La Harpe Golden
2013-10-17 19:26               ` Stefan Monnier
2013-10-20 13:57                 ` Rustom Mody
2013-10-21 10:46                   ` Xue Fuqiao
2013-10-21 13:03                   ` Stefan Monnier
2013-10-25 19:09                     ` Rustom Mody
2013-10-26  1:40                       ` Stefan Monnier
2013-10-26  4:38                         ` Rustom Mody
2013-10-26 10:35                           ` Juergen Sauermann
2013-10-26 11:42                             ` Rustom Mody
2013-10-26 15:40                             ` David De La Harpe Golden
2013-10-26 16:48                               ` Rustom Mody
2013-10-26 17:41                                 ` Rustom Mody
2013-10-26 17:48                                 ` David De La Harpe Golden
2013-10-27  5:08                           ` Stefan Monnier
2013-10-27 22:41                             ` Xue Fuqiao
2013-10-28  4:09                             ` Stephen J. Turnbull
2013-10-28 12:21                               ` Rustom Mody
2013-10-28 12:40                                 ` Juergen Sauermann
     [not found]                                   ` <CAJ+Teofv_2bHhdAvxsVRY8EYLQO6ERZ_zbAWh0FLQnUMndcfSg@mail.gmail.com>
     [not found]                                     ` <526E669E.60501@t-online.de>
     [not found]                                       ` <CAJ+TeofjYsy4eLDr=aM3Vo36=76zipbn7HmXcm59YNwkgLoaSg@mail.gmail.com>
     [not found]                                         ` <526E7EC3.3050305@t-online.de>
     [not found]                                           ` <526E967F.3010903@harpegolden.net>
     [not found]                                             ` <526E9DCE.8080504@t-online.de>
2013-10-28 17:42                                               ` Rustom Mody
2013-10-28 19:45                                                 ` David De La Harpe Golden
2013-10-18  7:06               ` Rustom Mody
2013-10-14 10:40         ` Rüdiger Sonderfeld
2013-10-14 17:03 ` David De La Harpe Golden
2013-10-14 19:48   ` Stefan Monnier
2013-10-15  3:15   ` Rustom Mody
  -- strict thread matches above, loose matches on Subject: below --
2013-10-12  5:01 Rustom Mody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJ+TeoeZ+B+_xEcMt+aTwkEj6ZAyB+UmeXQQozAdTHtCGZmn+w@mail.gmail.com \
    --to=rustompmody@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=ruediger@c-plusplus.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).