From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28241 invoked from network); 9 Feb 2001 14:00:23 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Feb 2001 14:00:23 -0000 Received: (qmail 23141 invoked by alias); 9 Feb 2001 14:00:16 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13450 Received: (qmail 23130 invoked from network); 9 Feb 2001 14:00:16 -0000 Date: Fri, 9 Feb 2001 15:00:14 +0100 (MET) Message-Id: <200102091400.PAA05871@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Oliver Kiddle's message of Thu, 8 Feb 2001 17:41:55 +0000 Subject: Re: PATCH: newsgroup completion Oliver Kiddle wrote: > ... > > I look in .newsrc* for newsgroups as this covers netscape and setups > like mine where I have configured tin's newsrctable for multiple news > servers. Having a glob also simplified the situation where .newsrc* > doesn't exit because zsh doesn't run the fgrep. I suppose we could > also add a style to specify a different newsrc file. Hmhm. Re-use `path'. > When no .newsrc file exists, I end up with _cache_newsgroups > containing one empty value (''). I got around this by using the > ${(w)#_cache_newsgroups} but it'd be nice if there was a parameter > expansion flag or maybe a typeset option to remove empty entries from > an array. Any opinions? I always use ${array:#}. > This newsgroup completion shows up a few problems with _multi_parts. > The suffix handling doesn't seem to work properly. If I use > _newsgroups -S',' I still get a space and not a comma after a full > newsgroup name. Handling of -S is non-trivial in _multiparts because there are so many placees where it has to use it itself. I've found one more place where the caller-supplied -S could be used, I think. > I'm also getting a problem after the first part of a newsgroup is > typed in full. e.g: > tin comp > gives me: > tin comp..comp. > I can reproduce this starting from zsh -f so it isn't my setup. And I think I fixed this, too. Bye Sven Index: Completion/Core/_multi_parts =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_multi_parts,v retrieving revision 1.4 diff -u -r1.4 _multi_parts --- Completion/Core/_multi_parts 2000/07/24 12:52:42 1.4 +++ Completion/Core/_multi_parts 2001/02/09 13:55:48 @@ -113,7 +113,7 @@ if [[ $#imm -ne 0 && $#matches -eq 1 ]] || zstyle -t ":completion:${curcontext}:" expand suffix; then - compadd "$group[@]" "$expl[@]" "$opts[@]" \ + compadd "$group[@]" "$expl[@]" "$sopts[@]" \ -M "r:|${sep}=* r:|=* $matcher" - "$pref$matches[1]" else if (( $matches[(I)${tmp1[1]}${sep}*] )); then @@ -235,7 +235,7 @@ SUFFIX="" if [[ -n "$pref" && "$orig" != "$pref" ]]; then - if [[ "$pref" = *${sep} ]]; then + if [[ "$pref" = *${sep}*${sep} ]]; then compadd "$group[@]" "$expl[@]" "$opts[@]" \ -p "${pref%${sep}*${sep}}${sep}" -S "$sep" \ -M "r:|${sep}=* r:|=* $matcher" - "${${pref%${sep}}##*${sep}}" -- Sven Wischnowsky wischnow@informatik.hu-berlin.de