zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@math.gatech.edu
Cc: Matthew Braun <matthew@ans.net>
Subject: Patch for spell-word with completeinword
Date: Tue, 19 Nov 1996 11:06:44 -0800	[thread overview]
Message-ID: <961119110644.ZM3836@candle.brasslantern.com> (raw)

This patch makes spell-word "aware" of COMPLETE_IN_WORD; with that option set,
it corrects spelling only in the prefix to the left of the cursor.

This is useful independent of my previous spname() patch if spell-word is
always invoked with the cursor on or immediately after a slash; with the
previous patch it makes less difference where the cursor is.

This patch *includes* my corrected version of Zoltan's patch for leading
tildes in the corrected word, from 3.1.0-test3; the diff is against 3.0.1.

*** Src/zle_tricky.c.0	Fri Nov 15 08:34:10 1996
--- Src/zle_tricky.c	Tue Nov 19 10:57:52 1996
***************
*** 674,691 ****
  	    inwhat = IN_CMD;
  
  	if (lst == COMP_SPELL) {
! 	    char **x = &s;
! 	    char *q = s;
  
! 	    for (; *q; q++)
  		if (INULL(*q))
  		    *q = Nularg;
- 	    untokenize(s);
  	    cs = wb;
! 	    foredel(we - wb);
! 	    /* call the real spell checker, ash@aaii.oz.zu */
! 	    spckword(x, 0, lincmd, 0);
! 	    inststr(*x);
  	} else if (COMP_ISEXPAND(lst)) {
  	    /* Do expansion. */
  	    char *ol = (olst == COMP_EXPAND_COMPLETE) ?
--- 674,700 ----
  	    inwhat = IN_CMD;
  
  	if (lst == COMP_SPELL) {
! 	    char *x, *q;
  
! 	    for (q = s; *q; q++)
  		if (INULL(*q))
  		    *q = Nularg;
  	    cs = wb;
! 	    if (unset(COMPLETEINWORD))
! 		foredel(we - wb);
! 	    else
! 		foredel(ocs - wb);
! 	    HEAPALLOC {
! 		x = dupstring(s);
! 		if (isset(COMPLETEINWORD))
! 		    x[ocs-cs] = 0;
! 		untokenize(x);
! 		if (*s == Tilde || *s == Equals || *s == String)
! 		    *x = *s;
! 		spckword(&x, 0, lincmd, 0);
! 	    } LASTALLOC;
! 	    untokenize(x);
! 	    inststr(x);
  	} else if (COMP_ISEXPAND(lst)) {
  	    /* Do expansion. */
  	    char *ol = (olst == COMP_EXPAND_COMPLETE) ?

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern


                 reply	other threads:[~1996-11-19 19:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=961119110644.ZM3836@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=matthew@ans.net \
    --cc=schaefer@nbn.com \
    --cc=zsh-workers@math.gatech.edu \
    /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).