zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: compadd -r without -S
@ 2003-01-06 19:23 Peter Stephenson
  2003-01-13 10:19 ` Sven Wischnowsky
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 2003-01-06 19:23 UTC (permalink / raw)
  To: Zsh hackers list

Does anybody (= Sven) see anything wrong with the following?  It allows
you to use the -r and -R options to compadd to delete an automatically
added space.  For example,

_foo() { _files -r '@#' }

removes the space automatically added if the next character typed is @
or #, which will help with the Perforce completion I am writing.  It
also overrides the removal of the space when you type `|' etc., so I
should probably write

_foo() { _files -r '@#\- \t\n;&|' }

to get the usual behaviour with other characters.

(I'm don't think this helps David Harris, since there's still no way of
overriding the default set of things to remove for general completions.)

This is not the same as

_foo() { _files -S ' ' -r '@#\- \t\n;&|' }

which would show the space when I don't want it, such as in menu
completion.

As far as I can see, this doesn't have any effect on existing valid uses
of -r or -R.

Index: Src/Zle/compresult.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v
retrieving revision 1.46
diff -u -r1.46 compresult.c
--- Src/Zle/compresult.c	30 Jul 2002 07:47:05 -0000	1.46
+++ Src/Zle/compresult.c	6 Jan 2003 19:09:56 -0000
@@ -1114,7 +1114,7 @@
 	    inststrlen(" ", 1, 1);
 	    minfo.insc++;
 	    if (minfo.we)
-		makesuffix(1);
+		makesuffixstr(m->remf, m->rems, 1);
 	}
     }
     if (minfo.we && partest && isset(AUTOPARAMKEYS))
Index: Doc/Zsh/compwid.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compwid.yo,v
retrieving revision 1.34
diff -u -r1.34 compwid.yo
--- Doc/Zsh/compwid.yo	1 Jul 2002 08:25:17 -0000	1.34
+++ Doc/Zsh/compwid.yo	6 Jan 2003 19:09:56 -0000
@@ -575,6 +575,10 @@
 backslash sequence is understood in this string: `tt(\-)' stands for
 all characters that insert nothing. Thus `tt(-S "=" -q)' is the same
 as `tt(-S "=" -r "= \t\n\-")'.
+
+This option may also be used without the tt(-S) option; then any
+automatically added space will be removed when one of the characters in the
+list is typed.
 )
 item(tt(-R) var(remove-func))(
 This is another form of the tt(-r) option. When a suffix 

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


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

* Re: PATCH: compadd -r without -S
  2003-01-06 19:23 PATCH: compadd -r without -S Peter Stephenson
@ 2003-01-13 10:19 ` Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 2003-01-13 10:19 UTC (permalink / raw)
  To: zsh-workers


Hello (happy new year to everyone...),

I meant to reply to this earlier but somehow I couldn't get the mail
through from my home...

Peter Stephenson wrote:

> Does anybody (= Sven) see anything wrong with the following?  It allows
> you to use the -r and -R options to compadd to delete an automatically
> added space.  For example,

Interesting idea and solution. I don't see any problems with this
either...


Bye
  Sven

-- 
Sven Wischnowsky                          wischnow@berkom.de


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

end of thread, other threads:[~2003-01-13 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-06 19:23 PATCH: compadd -r without -S Peter Stephenson
2003-01-13 10:19 ` Sven Wischnowsky

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