zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: [PATCH] Quote components before using it is pattern
Date: Sat, 21 Aug 2010 14:46:52 +0200	[thread overview]
Message-ID: <AANLkTimzOEX5ZvUorwx2UsvT2u+YjDfER6Gt6E1CZMvL@mail.gmail.com> (raw)
In-Reply-To: <20081014150144.GA3836@alea.gnuu.de>

On 14 October 2008 17:01, Jörg Sommer <joerg@alea.gnuu.de> wrote:
> Hi,
>
>> A component might contain a character active in patterns, like * or ().
>> Take for example the path /tmp/foobar). Passing this and /tmp/foo123 as a
>> completion to _multi_parts results in an error:
>>
>> _multi_parts:147: bad pattern: (foo123|foobar))*
>>
>> The characters in the temporary variable tmp1 must be quote, before the
>> pattern is build with them.
>
> Here is a simple test that shows the error in the old version:
>
> % compdef '_multi_parts -- / mpcompletions' mptest
> % mpcompletions=( a/foo\) a/f123 )
> % mptest a/<TAB>
> _multi_parts:147: bad pattern: (foo)|f123)*

This patch sort of breaks completing when the first segment has spaces
for me. They don't appear in the initial listing, but typing the first
char of their name sometimes completes them.
% compdef '_multi_parts -- / mpcompletions' mptest
% mpcompletions=3D( 'foo bar' 'foo baz' bar baz )
% mptest <TAB>ba<TAB>
bar baz

In this particular test, the foo bar and foo baz don't seem to appear
at all in the list, but they _are_ accepted (ie a space is inserted)
when they are typed in full. Removing the added (q) fixes this but of
course breaks the original case again. I have no idea what the line
does or how it does it.

The realworld case is zip- and tar-files that contain files with spaces.

-- 
Mikael Magnusson


  reply	other threads:[~2010-08-21 13:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-13 23:01 Jörg Sommer
2008-10-14 15:01 ` Jörg Sommer
2010-08-21 12:46   ` Mikael Magnusson [this message]
2010-08-21 16:54     ` Bart Schaefer
2010-08-21 17:04       ` Mikael Magnusson
2010-08-21 17:12       ` Bart Schaefer
2010-08-21 17:25         ` Mikael Magnusson

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=AANLkTimzOEX5ZvUorwx2UsvT2u+YjDfER6Gt6E1CZMvL@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).