zsh-workers
 help / color / mirror / code / Atom feed
* zstyle example
@ 2003-06-29 15:42 Clint Adams
  2003-07-04 16:35 ` Oliver Kiddle
  0 siblings, 1 reply; 4+ messages in thread
From: Clint Adams @ 2003-06-29 15:42 UTC (permalink / raw)
  To: zsh-workers; +Cc: 199083-forwarded

Chip Salzenberg says [ http://bugs.debian.org/199083 ] :

The zsh man page includes an example of how to control the tab
completion for 'rm':

	zstyle ':completion:*:*:rm:*' file-patterns \
		'*.o:object-files' '%p:all-files'

This example used to work but recently (I believe in 4.0.7-1) it
broke; it became necessary to replace the %p with *, which seems to
work, but I'm not sure whether the semantics are identical.

In any case the man page examples should work.


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

* Re: zstyle example
  2003-06-29 15:42 zstyle example Clint Adams
@ 2003-07-04 16:35 ` Oliver Kiddle
  2003-07-04 16:52   ` Peter Stephenson
  2003-07-06 17:59   ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Oliver Kiddle @ 2003-07-04 16:35 UTC (permalink / raw)
  To: zsh-workers; +Cc: 199083-forwarded

On 29 Jun, Clint wrote:
> Chip Salzenberg says [ http://bugs.debian.org/199083 ] :
> 
> The zsh man page includes an example of how to control the tab
> completion for 'rm':
> 
> 	zstyle ':completion:*:*:rm:*' file-patterns \
> 		'*.o:object-files' '%p:all-files'
> 
> This example used to work but recently (I believe in 4.0.7-1) it
> broke; it became necessary to replace the %p with *, which seems to
> work, but I'm not sure whether the semantics are identical.

The problem occurs on line 31 of _files which is:
  for i in ${tmp//%p/${${glob:-\*}//:/\\:}}; do

Changing it to:
  for i in ${tmp//\%p/${${glob:-\*}//:/\\:}}; do

allows it to work again but I can't see any good reason why the `%'
should need to be quoted so I assume that this is a bug introduced with
the recent changes to quoting in these substitutions.

Oliver


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

* Re: zstyle example
  2003-07-04 16:35 ` Oliver Kiddle
@ 2003-07-04 16:52   ` Peter Stephenson
  2003-07-06 17:59   ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2003-07-04 16:52 UTC (permalink / raw)
  To: zsh-workers, 199083-forwarded

Oliver Kiddle wrote:
> The problem occurs on line 31 of _files which is:
>   for i in ${tmp//%p/${${glob:-\*}//:/\\:}}; do
> 
> Changing it to:
>   for i in ${tmp//\%p/${${glob:-\*}//:/\\:}}; do
> 
> allows it to work again but I can't see any good reason why the `%'
> should need to be quoted so I assume that this is a bug introduced with
> the recent changes to quoting in these substitutions.

Ah, it's because of the fix that //% didn't do the same as what /% did
--- they should both treat the % specially as an instruction to anchor
the match at the end of the string.  Logically, it should also have been
quoted, so this fix is correct.  (I find it an annoying notation for
just this sort of reason; zsh's substitution flags are much neater, but
this form is compatible with other shells.)

-- 
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] 4+ messages in thread

* Re: zstyle example
  2003-07-04 16:35 ` Oliver Kiddle
  2003-07-04 16:52   ` Peter Stephenson
@ 2003-07-06 17:59   ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2003-07-06 17:59 UTC (permalink / raw)
  To: zsh-workers

On Jul 4,  6:35pm, Oliver Kiddle wrote:
}
} The problem occurs on line 31 of _files which is:
}   for i in ${tmp//%p/${${glob:-\*}//:/\\:}}; do

It appears Functions/Prompts/prompt_adam2_setup may have the same problem,
on lines 79 and 80.


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

end of thread, other threads:[~2003-07-06 20:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-29 15:42 zstyle example Clint Adams
2003-07-04 16:35 ` Oliver Kiddle
2003-07-04 16:52   ` Peter Stephenson
2003-07-06 17:59   ` Bart Schaefer

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