zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: PATCH: compadd -r without -S
Date: Mon, 06 Jan 2003 19:23:29 +0000	[thread overview]
Message-ID: <14806.1041881009@csr.com> (raw)

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


             reply	other threads:[~2003-01-06 19:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-06 19:23 Peter Stephenson [this message]
2003-01-13 10:19 ` Sven Wischnowsky

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=14806.1041881009@csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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).