From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 912 invoked from network); 1 May 2000 18:40:24 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 May 2000 18:40:24 -0000 Received: (qmail 14098 invoked by alias); 1 May 2000 18:40:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11044 Received: (qmail 14083 invoked from network); 1 May 2000 18:40:14 -0000 To: zsh-workers@sunsite.auc.dk Subject: spellchecker for users of dvorak layout MIME-Version: 1.0 (generated by EMIKO 1.13.9 - "Euglena tripteris") Content-Type: text/plain; charset=US-ASCII From: Hiroki Tamakoshi Date: 02 May 2000 03:40:10 +0900 Message-ID: <81itwy3yid.fsf@migi.aist-nara.ac.jp> User-Agent: T-gnus/6.13.3 (based on Pterodactyl Gnus v0.98) EMIKO/1.13.9 (Euglena tripteris) FLIM/1.13.2 (Kasanui) APEL/10.2 Emacs/20.5 (alpha-debian-linux-gnu) MULE/4.0 (HANANOEN) Sender: Hiroki Tamakoshi Hi, I'm a new comer of this mailing list. I decided to subscribe this ML to propose a new function of the Z shell. I'm a user of dvorak key layout, so sometimes annoyed with spellchecker which is fixed to qwerty layout. So I modified the source codes of 3.1.7-pre-1 to be able to change the layout table dynamically by typing `setopt dvorak'. How about this function? I modified Src/{zsh.h,options.c,utils.c}. I'll put some patches in this mail. (I don't know the correct usage of diff command, sorry.) --- Src/zsh.h.orig Thu Apr 20 04:03:47 2000 +++ Src/zsh.h Tue May 2 02:05:48 2000 @@ -1431,6 +1431,7 @@ VERBOSE, XTRACE, USEZLE, + DVORAK, OPT_SIZE }; --- Src/options.c.orig Thu Apr 20 04:03:46 2000 +++ Src/options.c Tue May 2 01:42:16 2000 @@ -210,6 +210,7 @@ {NULL, "promptvars", OPT_ALIAS, /* bash */ PROMPTSUBST}, {NULL, "stdin", OPT_ALIAS, /* ksh */ SHINSTDIN}, {NULL, "trackall", OPT_ALIAS, /* ksh */ HASHCMDS}, +{NULL, "dvorak", 0, DVORAK}, {NULL, NULL, 0, 0} }; --- Src/utils.c.orig Thu Apr 6 04:36:54 2000 +++ Src/utils.c Tue May 2 02:20:02 2000 @@ -2127,7 +2127,7 @@ spdist(char *s, char *t, int thresh) { char *p, *q; - char *keymap = + const char qwertykeymap[] = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ \t1234567890-=\t\ \tqwertyuiop[]\t\ @@ -2139,6 +2139,23 @@ \tASDFGHJKL:\"\n\t\ \tZXCVBNM<>?\n\n\t\ \n\n\n\n\n\n\n\n\n\n\n\n\n\n"; + const char dvorakkeymap[] = + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ +\t1234567890[]\t\ +\t',.pyfgcrl/=\t\ +\taoeuidhtns-\n\t\ +\t;qjkxbmwvz\t\t\t\ +\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ +\t!@#$%^&*(){}\t\ +\t\"<>PYFGCRL?+\t\ +\tAOEUIDHTNS_\n\t\ +\t:QJKXBMWVZ\n\n\t\ +\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; + const char *keymap; + if ( isset( DVORAK ) ) + keymap = dvorakkeymap; + else + keymap = qwertykeymap; if (!strcmp(s, t)) return 0;