From: Hiroki Tamakoshi <hiroki-t@is.aist-nara.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: spellchecker for users of dvorak layout
Date: 02 May 2000 03:40:10 +0900 [thread overview]
Message-ID: <81itwy3yid.fsf@migi.aist-nara.ac.jp> (raw)
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;
next reply other threads:[~2000-05-01 18:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-01 18:40 Hiroki Tamakoshi [this message]
2000-05-08 13:12 ` Hiroki Tamakoshi
2000-05-08 15:42 ` Peter Stephenson
2000-05-08 15:56 ` Adam Spiers
2000-05-08 16:03 ` Bart Schaefer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81itwy3yid.fsf@migi.aist-nara.ac.jp \
--to=hiroki-t@is.aist-nara.ac.jp \
--cc=zsh-workers@sunsite.auc.dk \
/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.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).