From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10084 invoked from network); 6 Jan 2003 19:24:06 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 6 Jan 2003 19:24:06 -0000 Received: (qmail 17180 invoked by alias); 6 Jan 2003 19:23:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 18059 Received: (qmail 17170 invoked from network); 6 Jan 2003 19:23:59 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: PATCH: compadd -r without -S Date: Mon, 06 Jan 2003 19:23:29 +0000 Message-ID: <14806.1041881009@csr.com> From: Peter Stephenson 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 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. **********************************************************************