From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rustom Mody Newsgroups: gmane.emacs.devel Subject: Re: APL mode Date: Mon, 14 Oct 2013 12:15:37 +0530 Message-ID: References: <2556707.G5KkrEK5zp@descartes> <2175241.EV4ttzPlpJ@descartes> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1381733165 22591 80.91.229.3 (14 Oct 2013 06:46:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Oct 2013 06:46:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?ISO-8859-1?Q?R=FCdiger_Sonderfeld?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 14 08:46:09 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VVbur-0001UQ-2m for ged-emacs-devel@m.gmane.org; Mon, 14 Oct 2013 08:46:09 +0200 Original-Received: from localhost ([::1]:35533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVbuq-0002pq-Oq for ged-emacs-devel@m.gmane.org; Mon, 14 Oct 2013 02:46:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVbuh-0002f6-T6 for emacs-devel@gnu.org; Mon, 14 Oct 2013 02:46:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVbuh-0005z0-3l for emacs-devel@gnu.org; Mon, 14 Oct 2013 02:45:59 -0400 Original-Received: from mail-pa0-x22a.google.com ([2607:f8b0:400e:c03::22a]:38925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVbug-0005yq-SA for emacs-devel@gnu.org; Mon, 14 Oct 2013 02:45:59 -0400 Original-Received: by mail-pa0-f42.google.com with SMTP id lj1so7186296pab.1 for ; Sun, 13 Oct 2013 23:45:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=Ipqr3Cp88iPQFrkDBz7wT3y5u+UHpSOT86Nl8WrP/Uk=; b=vB4yJI3WeWSE2FieSG8wzWUFyWOI92koFHucymyr1tykNgwvH23Y1K5LDTyiojkUKX Q7kH0GbFUr6gbaQ4szDwToENaB9bSArTNPiBJLGELHr3bcVSdvuLbR6fwVOEw+VR7L9f URKIvRJcZls+yNDmInqjjsuJf00XgoCUlr05XsygzCdFzRxnufzCI/NehuEozEjW+EFv wSZKn9cK9qQTKaC2GkpaZcAuQpNJUfG9fnBqaJQuNkK+XfUqgfp364LBpZS0bRXQe6Rf dhDnGsS2Js8hfhPR3FFGhowaNcJF62Nv3HIuA08rzEhmlQotZ9mzlskJFmIXBVC1jaDb M41g== X-Received: by 10.68.33.100 with SMTP id q4mr34181341pbi.119.1381733157855; Sun, 13 Oct 2013 23:45:57 -0700 (PDT) Original-Received: by 10.68.133.198 with HTTP; Sun, 13 Oct 2013 23:45:37 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22a X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164193 Archived-At: 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 =C2=B6 ;; 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 "`=E2=97=8A=E2=8D=A8=C2=B61=C2=A8=C2=A1=C2=B62=C2=AF=E2=82=AC=C2=B63<=C2=A3= =C2=B64=E2=89=A4=E2=8D=A7=C2=B65=3D =C2=B66=E2=89=A5 =C2=B67> =C2=B68=E2=89= =A0=E2=8D=82=C2=B69=E2=88=A8=E2=8D=B1=C2=B60=E2=88=A7=E2=8D=B2=C2=B6-=C3=97= =E2=89=A1=C2=B6=3D=C3=B7=E2=8C=B9" ;; qwertyuiop row "q?=C2=BF=C2=B6w=E2=8D=B5=E2=8C=BD=C2=B6e=E2=88=88=E2=8D=B7=C2=B6r=E2=8D=B4= =C2=B6t=E2=88=BC=E2=8D=89=C2=B6y=E2=86=91=C2=A5=C2=B6u=E2=86=93 =C2=B6i=E2= =8D=B3=E2=8D=B8=C2=B6o=E2=97=8B=E2=8D=A5=C2=B6p=E2=8B=86=E2=8D=9F=C2=B6[=E2= =86=90 =C2=B6]=E2=86=92 " ;; asdfghjkl row "a=E2=8D=BA=E2=8A=96=C2=B6s=E2=8C=88 =C2=B6d=E2=8C=8A =C2=B6f_=E2=8D=AB=C2= =B6g=E2=88=87=E2=8D=92=C2=B6h=E2=88=86=E2=8D=8B=C2=B6j=E2=88=98=E2=8D=A4=C2= =B6k'=E2=8C=BA=C2=B6l=E2=8E=95=E2=8D=9E=C2=B6;=E2=8A=A2 =C2=B6'=E2=8A=A3 " ;; zxcvbnm row "z=E2=8A=82 =C2=B6x=E2=8A=83 =C2=B6c=E2=88=A9=E2=8D=9D=C2=B6v=E2=88=AA =C2= =B6b=E2=8A=A5=E2=8D=8E=C2=B6n=E2=8A=A4=E2=8D=95=C2=B6m|=E2=8C=B6=C2=B6,=E2= =8C=B7=E2=8D=AA=C2=B6.=E2=8D=8E=E2=8D=99=C2=B6/=E2=8D=95=E2=8C=BF" )) (setq apl-map1 (make-sparse-keymap)) (define-key apl-mode-map (kbd "") apl-map1) (setq apl-map2 (make-sparse-keymap)) (define-key apl-mode-map (kbd "") apl-map2) (dolist (line apl-keyboard) (dolist (key (split-string line "=C2=B6")) (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))) )