zsh-workers
 help / color / mirror / code / Atom feed
* spellchecker for users of dvorak layout
@ 2000-05-01 18:40 Hiroki Tamakoshi
  2000-05-08 13:12 ` Hiroki Tamakoshi
  0 siblings, 1 reply; 5+ messages in thread
From: Hiroki Tamakoshi @ 2000-05-01 18:40 UTC (permalink / raw)
  To: zsh-workers

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;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: spellchecker for users of dvorak layout
  2000-05-01 18:40 spellchecker for users of dvorak layout Hiroki Tamakoshi
@ 2000-05-08 13:12 ` Hiroki Tamakoshi
  2000-05-08 15:42   ` Peter Stephenson
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Hiroki Tamakoshi @ 2000-05-08 13:12 UTC (permalink / raw)
  To: zsh-workers

My patch seems to be rejected to see that there's no discussion about
dvorak layout and my patch, and 3.1.7-pre-3 does't reflect my patch.
Indeed the number of dvorak users may be small, but some number of
users become happy with my patch, I think.

How can I contribute to zsh with this patch?
Or how can I access to the cvs repository?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: spellchecker for users of dvorak layout
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2000-05-08 15:42 UTC (permalink / raw)
  To: Zsh hackers list

> My patch seems to be rejected to see that there's no discussion about
> dvorak layout and my patch, and 3.1.7-pre-3 does't reflect my patch.
> Indeed the number of dvorak users may be small, but some number of
> users become happy with my patch, I think.
> 
> How can I contribute to zsh with this patch?
> Or how can I access to the cvs repository?

I forgot about this.  It's fairly small, so it might as well be added,
though I'm not really sure how much you gain by examining the keyboard
layout anyway.  Here's some documentation.

Index: Doc/Zsh/options.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/options.yo,v
retrieving revision 1.2
diff -u -r1.2 options.yo
--- Doc/Zsh/options.yo	2000/04/16 19:02:13	1.2
+++ Doc/Zsh/options.yo	2000/05/08 15:37:19
@@ -326,6 +326,12 @@
 in a command have no matches.
 Overrides tt(NULL_GLOB).
 )
+pindex(DVORAK)
+item(tt(DVORAK))(
+Use the Dvorak keyboard instead of the standard qwerty keyboard as a basis
+for examining spelling mistakes for the tt(CORRECT) and tt(CORRECT_ALL)
+options and the tt(spell-word) editor command.
+)
 pindex(EQUALS)
 cindex(filename expansion, =)
 item(tt(EQUALS) <Z>)(

-- 
Peter Stephenson <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: spellchecker for users of dvorak layout
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Adam Spiers @ 2000-05-08 15:56 UTC (permalink / raw)
  To: zsh-workers

Hiroki Tamakoshi (hiroki-t@is.aist-nara.ac.jp) wrote:
> My patch seems to be rejected to see that there's no discussion about
> dvorak layout and my patch, and 3.1.7-pre-3 does't reflect my patch.
> Indeed the number of dvorak users may be small, but some number of
> users become happy with my patch, I think.

I would certainly like to see this patch go in -- I'm in the process
of learning Dvorak at the moment.

What's the current policy for committing patches to CVS contributed by
those without write access?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: spellchecker for users of dvorak layout
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2000-05-08 16:03 UTC (permalink / raw)
  To: Hiroki Tamakoshi, zsh-workers

On May 8, 10:12pm, Hiroki Tamakoshi wrote:
} Subject: Re: spellchecker for users of dvorak layout
}
} My patch seems to be rejected to see that there's no discussion about
} dvorak layout and my patch, and 3.1.7-pre-3 does't reflect my patch.

My apologies; I meant to repond to your message and have not yet.

So I will now.

I've made noises in the now-distant past about making spell-checking
customizable after the manner of the new completion system.  (See 2407
and 4577 for examples.)  We ended up doing approximation in completion
entirely independently of spell-checking.

However, I still think it'd be useful to put a hook in spckword() for
e.g. calling to a user-defined function that could perform whatever
corrections the user likes.  This would be preferable to adding yet
another option, I think.

Now, as I type, this arrives from PWS:

On May 8,  4:42pm, Peter Stephenson wrote:
} Subject: Re: spellchecker for users of dvorak layout
}
} I forgot about this.  It's fairly small, so it might as well be added,

My only objection is above.

} though I'm not really sure how much you gain by examining the keyboard
} layout anyway.

It's used to disambiguate so as to offer only a single correction.  You
don't gain much when alternatives could result from missed keys in more
than one direction, which does happen occasionally.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-05-08 16:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-01 18:40 spellchecker for users of dvorak layout Hiroki Tamakoshi
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

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).