zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: Re: cvs completion does not support partial path completion
Date: Tue, 8 May 2001 10:45:14 +0200 (MET DST)	[thread overview]
Message-ID: <200105080845.KAA03638@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: <1010507145218.ZM27680@candle.brasslantern.com>

Bart Schaefer wrote:

> ...
> 
> } If you don't want that, we could probably special-case that single space
> } to mean to not pass a -X.
> 
> Either that, or strip all leading/trailing whitespace from the message,
> and ignore empty messages.

Yes, that's better.


Bye
  Sven

Index: Completion/Base/Core/_description
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Core/_description,v
retrieving revision 1.1
diff -u -r1.1 _description
--- Completion/Base/Core/_description	2001/04/02 11:03:01	1.1
+++ Completion/Base/Core/_description	2001/05/08 08:44:49
@@ -9,7 +9,8 @@
   shift
 fi
 
-_lastdescr=( "$_lastdescr[@]" "$3" )
+3="${${3##[[:blank:]]#}%%[[:blank:]]#}"
+[[ -n "$3" ]] && _lastdescr=( "$_lastdescr[@]" "$3" )
 
 zstyle -s ":completion:${curcontext}:$1" group-name gname &&
     [[ -z "$gname" ]] && gname="$1"
@@ -51,7 +52,11 @@
 fi
 
 shift 2
-[[ -n "$format" ]] && zformat -f format "$format" "d:$1" "${(@)argv[2,-1]}"
+if [[ -z "$1" && $# -eq 1 ]]; then
+  format=
+elif [[ -n "$format" ]]; then
+  zformat -f format "$format" "d:$1" "${(@)argv[2,-1]}"
+fi
 
 if [[ -n "$gname" ]]; then
   if [[ -n "$format" ]]; then
Index: Doc/Zsh/compsys.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v
retrieving revision 1.121
diff -u -r1.121 compsys.yo
--- Doc/Zsh/compsys.yo	2001/04/27 09:12:34	1.121
+++ Doc/Zsh/compsys.yo	2001/05/08 08:44:52
@@ -2879,7 +2879,9 @@
 This describes the var(n)'th normal argument.  The var(message) will be 
 printed above the matches generated and the var(action) says what can
 be completed in this position (see below).  If there are two colons
-before the var(message), this describes an optional argument.
+before the var(message), this describes an optional argument.  If the
+var(message) contains only white space, nothing will be printed above
+the matches unless the action adds an explanation string itself.
 )
 xitem(tt(:)var(message)tt(:)var(action))
 item(tt(::)var(message)tt(:)var(action))(
@@ -3008,7 +3010,8 @@
 item(tt(::)var(message)tt(:)var(action))(
 Describes a mandatory argument with one colon, or an optional argument
 with two colons.  As in other forms of var(spec), the var(message) will be
-printed above the matches generated and the var(action) says what can be
+printed above the matches generated (unless it contains only white
+space, see above) and the var(action) says what can be
 completed in this position.
 )
 xitem(tt(:*)var(pattern)tt(:)var(message)tt(:)var(action))
@@ -3460,7 +3463,11 @@
 
 The string returned by the tt(format) style (if any) will be modified so
 that the sequence `tt(%d)' is replaced by the var(descr) given as the third
-argument.  If tt(_description) is called with more than three arguments,
+argument without any leading or trailing white space.  If, after
+removing the white space, the var(descr) is the empty string, the format
+style will not be used and the options put into the var(name) array will
+not contain an explantion string to be displayed above the matches.If
+tt(_description) is called with more than three arguments,
 the additional var(specs) should be of the form `var(char)tt(:)var(str)'
 and every appearance of `tt(%)var(char)' in the format string will be
 replaced by var(string).

-- 
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


  reply	other threads:[~2001-05-08  8:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-26 14:05 Andrej Borsenkow
2001-04-27 12:20 ` Sven Wischnowsky
2001-04-27 13:08   ` Andrej Borsenkow
2001-04-27 13:22     ` Sven Wischnowsky
2001-04-27 17:54   ` Bart Schaefer
2001-04-30  8:17     ` Sven Wischnowsky
2001-04-30 16:56       ` Bart Schaefer
2001-05-01  9:39         ` Tanaka Akira
2001-05-04  5:16           ` PATCH: " Bart Schaefer
2001-05-04 16:26             ` Bart Schaefer
2001-05-07  7:58               ` Sven Wischnowsky
2001-05-07 14:52                 ` Bart Schaefer
2001-05-08  8:45                   ` Sven Wischnowsky [this message]
2001-05-04 16:39             ` Bart Schaefer

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=200105080845.KAA03638@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --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).