zsh-users
 help / color / mirror / code / Atom feed
* Re: tcsh's autocorrect functionality wanted
@ 1996-11-14 23:18 Matthew Braun
  1996-11-15  6:55 ` ANSI zsh? Kosh
  1996-11-15  8:50 ` tcsh's autocorrect functionality wanted Bart Schaefer
  0 siblings, 2 replies; 8+ messages in thread
From: Matthew Braun @ 1996-11-14 23:18 UTC (permalink / raw)
  To: schaefer, zsh-users

"Bart Schaefer" <schaefer@candle.brasslantern.com> on Thu, 14 Nov 1996  0:23 writes:
> On Nov 11,  9:24pm, Matthew Braun wrote:
> }      autocorrect (+)
> }              If set, the spell-word  editor  command  is  invoked
> }              automatically before each completion attempt.
> 
> That would be pretty trivial to add, I think, except for the bugs in
> spell-word described below.

Trivial for someone who already knows the code.  Any maintainers out
there listening?  Please add this.  Thanks!

> The way you do that sort of thing is like this:
> 
> 	# bindkey '\es' spell-word	# already the default
> 	bindkey '\C-x\C-i' expand-or-complete-prefix
> 	bindkey -s '\t' '\es\C-x\C-i'

That's cool, thanks!

> However, spell-word isn't clever.  It doesn't deal properly with a path
> beginning with a tilde (~) -- I consider this to be a bug, because this
> IS handled by `setopt correctall` -- and it does not know how to fix up
> the path prefix when the suffix is "too far" from the correct spelling.
> 
> Finally, spell-word ignores `setopt completeinword` and always behaves
> as if `setopt awaystoend`, so the cursor ends up in what may be a very
> wrong place after spelling is completed.

Zsh masters, can these things related to spell-word be put on the TODO
list?  If there is such a list that is, as I don't see one in the
distribution tree.

It would be nice if the autocorrect that uses the spell-word stuff would
cover spell checking each part of the path for filenames, so it would
cover this example (assumes there are no other files that start with
pas* in the /etc directory):

zsh$ cat /ect/pas<tab>
expands to:
zsh$ cat /etc/passwd

> So for now you can try the binding above; or you can look at "multicomp"
> in the Functions/ directory of the zsh distribution, write yourself a
> little program that does spell checking, and replace `reply=(${~reply})'
> in that function with `reply=( $(spellcheck ${~reply}) )'.  For a basis
> of the spell-checking program, you can cannibalize Src/utils.c for the
> functions spname(), mindist(), and spdist().

This seems like it would be slow, and given the number of times I hit
"tab" any slowness would likely be very annoying!  ;-)

Bart, mind giving me some examples of how completeinword and awaystoend
work?  I tried setting these and hitting tab in a few instances, but it
didn't seem to change the behavior.  I can see where it would be nice if
COMPLETE_IN_WORD worked for spell-word, but I don't see it actually
affecting anything right now.

Thanks,

Matthew.


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

* ANSI zsh?
  1996-11-14 23:18 tcsh's autocorrect functionality wanted Matthew Braun
@ 1996-11-15  6:55 ` Kosh
  1996-11-21 21:26   ` John Benninghoff
  1996-11-15  8:50 ` tcsh's autocorrect functionality wanted Bart Schaefer
  1 sibling, 1 reply; 8+ messages in thread
From: Kosh @ 1996-11-15  6:55 UTC (permalink / raw)
  To: zsh-users

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=US-ASCII, Size: 793 bytes --]

Greetings fellow ZSH users,

I was wondering where I could find ZSH scripts that will colourize the
shell (ie. have ANSI support, y'know).  I've seen BASH shell screens that
had executables in "red", directories in "blue", etc.  It makes it easy to
see things at a glance when it's in colour. :)  Also, are there any sites
that have more zsh scripts?  I used the default ones that come with 
zsh 3.0.1, and it works wonderfully.  Colour would be a nice touch,
wouldn't it?  :)

Thanks for any advice!

--
 Sirius Bontea, E-3
-=ðUnited States Air Forceð=-
Email:   <mariah@isis.interpac.net>
Web page:   http://home.interpac.net/~mariah/index.html
IRC:  ]{osh@EfNet  on  #Mariah  =)
Administrator of the Mariah Carey Marketplace.
==== For more details,  'finger mariah@isis.interpac.net' ====


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

* Re: tcsh's autocorrect functionality wanted
  1996-11-14 23:18 tcsh's autocorrect functionality wanted Matthew Braun
  1996-11-15  6:55 ` ANSI zsh? Kosh
@ 1996-11-15  8:50 ` Bart Schaefer
  1 sibling, 0 replies; 8+ messages in thread
From: Bart Schaefer @ 1996-11-15  8:50 UTC (permalink / raw)
  To: Matthew Braun, zsh-users

On Nov 14,  6:18pm, Matthew Braun wrote:
} Subject: Re: tcsh's autocorrect functionality wanted
}
} > }      autocorrect (+)
} > 
} > That would be pretty trivial to add, I think, except for the bugs in
} > spell-word described below.
} 
} Trivial for someone who already knows the code.  Any maintainers out
} there listening?  Please add this.  Thanks!

I already sent a partial patch to zsh-workers for consideration.  No one
has bitten yet.

} Bart, mind giving me some examples of how completeinword and awaystoend
} work?  I tried setting these and hitting tab in a few instances, but it
} didn't seem to change the behavior.  I can see where it would be nice if
} COMPLETE_IN_WORD worked for spell-word, but I don't see it actually
} affecting anything right now.

First, note that complete_in_word works only with expand-or-complete,
not with expand-or-complete-prefix.  If you have tab bound to complete
prefixes, you won't see any change in behavior.

Complete_in_word lets you place the cursor in the middle of a word (it's
really only interesting for file paths) and do completion on the part of
the word to the left of the cursor.

Normally, the cursor is left in the middle of the word when this happens;
but if you also set always_to_end, the cursor moves to the end of the word
when the completion is unique.

Complete_in_word succeeds on the left portion only if continuing the
completion with the right portion would also succeed.  This is the
desired behavior (otherwise it'd just be expand-or-complete-prefix), but
it means that it is nearly useless unless you also set glob_complete (so
that partial file (or directory) names may appear to the right).

Here's an example, starting from "zsh -f".

zagzig% ls -dF ~/*/farm*
/home/schaefer/homepage/farm/     /home/schaefer/tmp/farm1.xbm
/home/schaefer/public_html/farm/  /home/schaefer/tmp/farm2.xbm
/home/schaefer/tmp/farm.gif
zagzig% setopt completeinword menucomplete
zagzig% xv ~//farm

At this point, if I move the cursor to the second slash (so insertion
is between the two slashes) and press TAB, I first see:

zagzig% xv ~/homepage/farm

with cursor still on the second slash.  Press TAB again:

zagzig% xv ~/public_html/farm

with cursor still on the second slash.  Repeated presses of TAB cycle
back and forth through these two choices.  Now:

zagzig% setopt alwaystoend
zagzig% xv ~//farm

Again move the cursor to the second slash and press TAB.  This time:

zagzig% xv ~/homepage/farm/

and the cursor is at the end of the word.  TAB again cycles to

zagzig% xv ~/public_html/farm/

Next:

zagzig% setopt globcomplete
zagzig% xv ~//farm

Now "farm" can act as a partial word, and I can cycle THREE choices:

zagzig% xv ~/homepage/farm/
zagzig% xv ~/public_html/farm/
zagzig% xv ~/tmp/farm

The cursor moves to the end of each path because of always_to_end;
with that unset, the cursor would stay at the second slash, but I'd
still be cycling the same three choices.

Again, the difference vs. bindkey \\t expand-or-complete-prefix is
that your choices for the completion of the left part of the word
are limited by what appears in the right part of the word.

Personally, what I'd really like is to be able to attempt this kind
of behavior, and then revert to expand-or-complete-prefix only if
this finds no possible completions.  But zsh doesn't support that
kind of conditional action in bindkey sequences; instead, you have to
write a custom function and figure out a compctl for it, which can be
a lot slower and can't be bound directly to a key.

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


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

* ANSI zsh?
  1996-11-15  6:55 ` ANSI zsh? Kosh
@ 1996-11-21 21:26   ` John Benninghoff
  1996-11-21 23:13     ` Vincent Lefevre
  0 siblings, 1 reply; 8+ messages in thread
From: John Benninghoff @ 1996-11-21 21:26 UTC (permalink / raw)
  To: zsh-users

This usually a function of GNU ls --color=tty.  It is enable by default
on SlackWare Linux using a color terminal.

-- 
John Benninghoff

Regarding "ANSI zsh?", Kosh writes:
> Greetings fellow ZSH users,
> 
> I was wondering where I could find ZSH scripts that will colourize the
> shell (ie. have ANSI support, y'know).  I've seen BASH shell screens that
> had executables in "red", directories in "blue", etc.  It makes it easy t=
> o
> see things at a glance when it's in colour. :)  Also, are there any sites
> that have more zsh scripts?  I used the default ones that come with=20
> zsh 3.0.1, and it works wonderfully.  Colour would be a nice touch,
> wouldn't it?  :)
> 
> Thanks for any advice!
> 
> --
>  Sirius Bontea, E-3
> -=3D=F0United States Air Force=F0=3D-
> Email:   <mariah@isis.interpac.net>
> Web page:   http://home.interpac.net/~mariah/index.html
> IRC:  ]{osh@EfNet  on  #Mariah  =3D)
> Administrator of the Mariah Carey Marketplace.
> =3D=3D=3D=3D For more details,  'finger mariah@isis.interpac.net' =3D=3D=3D=
> =3D
> 


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

* Re: ANSI zsh?
  1996-11-21 21:26   ` John Benninghoff
@ 1996-11-21 23:13     ` Vincent Lefevre
  1996-11-21 23:39       ` Jose Unpingco
  0 siblings, 1 reply; 8+ messages in thread
From: Vincent Lefevre @ 1996-11-21 23:13 UTC (permalink / raw)
  To: zsh-users

Hi,

> This usually a function of GNU ls --color=tty.  It is enable by default
> on SlackWare Linux using a color terminal.

Where can I get it? I haven't seen any gnu color-ls on ftp sites.

TIA,

-- 
Vincent Lefevre, vlefevre@ens-lyon.fr | Acorn Risc PC, StrongARM @ 202MHz
http://www.ens-lyon.fr/~vlefevre      | 20+1MB RAM, Eagle M2, TV + Teletext
PhD in Computer Science, 1st year     | Apple CD-300, SyQuest 270MB (SCSI)
-----------------------------------------------------------------------------


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

* Re: ANSI zsh?
  1996-11-21 23:13     ` Vincent Lefevre
@ 1996-11-21 23:39       ` Jose Unpingco
  0 siblings, 0 replies; 8+ messages in thread
From: Jose Unpingco @ 1996-11-21 23:39 UTC (permalink / raw)
  To: Vincent Lefevre; +Cc: zsh-users

I have an old tar file for color-ls that I pulled off the net some
months back. If you're interested, I can put it on my ftp site for you
to get unless I can mail you a uuencoded version of the compressed
file.

Otherwise, you can poke around here...

ftp://sunsite.unc.edu/pub/Linux/distributions/slackware/source
        a/bin/color-ls-3.12.0.2.patch.gz


Vincent Lefevre said:
> 
> Hi,
> 
> > This usually a function of GNU ls --color=tty.  It is enable by default
> > on SlackWare Linux using a color terminal.
> 
> Where can I get it? I haven't seen any gnu color-ls on ftp sites.
> 
> TIA,
> 
> -- 
> Vincent Lefevre, vlefevre@ens-lyon.fr | Acorn Risc PC, StrongARM @ 202MHz
> http://www.ens-lyon.fr/~vlefevre      | 20+1MB RAM, Eagle M2, TV + Teletext
> PhD in Computer Science, 1st year     | Apple CD-300, SyQuest 270MB (SCSI)
> -----------------------------------------------------------------------------
> 
> 


-- 
Thank you for your time and consideration.  

             _ - - - _                             
           /)-  - _     _                          
          / |_o_/  -       _        
              \__  -          _        
                \ \_              -   _  _  _  _   _  _  _  _  _       
                 _                      
   __ __ _ _  -        
Jose Unpingco                                Mail Code ECE 0407
HM# (619) 622-1243                           WK# (619) 534-5809


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

* Re: ANSI zsh?
  1996-11-21 23:25 ANSI zsh? Matthew Braun
@ 1996-11-22  5:55 ` Aki Vehtari
  0 siblings, 0 replies; 8+ messages in thread
From: Aki Vehtari @ 1996-11-22  5:55 UTC (permalink / raw)
  To: zsh-users


"Matthew" == Matthew Braun <matthew@ans.net> writes:
> There isn't a separate GNU ls that has color, it is built into the
> standard GNU ls.

> If you run a color terminal, like color_xterm, then run gnu's ls with
> the "--color=tty" option, you will see colors.


The GNU ls is part of the GNU fileutils and "--color=tty" option was
added to GNU ls in fileutils-3.13 (which is the latest version AFAIK)


	Aki


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

* Re: ANSI zsh?
@ 1996-11-21 23:25 Matthew Braun
  1996-11-22  5:55 ` Aki Vehtari
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Braun @ 1996-11-21 23:25 UTC (permalink / raw)
  To: Vincent Lefevre, zsh-users

Vincent Lefevre <Vincent.Lefevre@ens-lyon.fr> on Fri, 22 Nov 1996  0:13 writes:
> Hi,
> 
> > This usually a function of GNU ls --color=tty.  It is enable by default
> > on SlackWare Linux using a color terminal.
> 
> Where can I get it? I haven't seen any gnu color-ls on ftp sites.

There isn't a separate GNU ls that has color, it is built into the
standard GNU ls.

If you run a color terminal, like color_xterm, then run gnu's ls with
the "--color=tty" option, you will see colors.

Matthew.


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

end of thread, other threads:[~1996-11-22  6:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-14 23:18 tcsh's autocorrect functionality wanted Matthew Braun
1996-11-15  6:55 ` ANSI zsh? Kosh
1996-11-21 21:26   ` John Benninghoff
1996-11-21 23:13     ` Vincent Lefevre
1996-11-21 23:39       ` Jose Unpingco
1996-11-15  8:50 ` tcsh's autocorrect functionality wanted Bart Schaefer
1996-11-21 23:25 ANSI zsh? Matthew Braun
1996-11-22  5:55 ` Aki Vehtari

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