zsh-users
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-users@zsh.org
Subject: Re: GLOB_COMPLETE and numbered directories
Date: Thu, 19 Mar 2015 23:18:49 +0000	[thread overview]
Message-ID: <20150319231849.GD2653@tarsus.local2> (raw)
In-Reply-To: <150319090612.ZM18787@torch.brasslantern.com>

Bart Schaefer wrote on Thu, Mar 19, 2015 at 09:06:12 -0700:
> On Mar 19,  7:32am, Daniel Shahaf wrote:
> } Subject: GLOB_COMPLETE and numbered directories
> }
> } Consider the following:
> } 
> } % mkdir -p {bar,baz}/iota
> } % cat b/i<TAB>
> } [cycles between 'cat ba<CURSOR>/iota', 'cat bar/iota/', 'cat baz/iota/']
> 
> Not what I see here.
> - First tab does ba<C>/iota
> - Second tab shows list of bar/iota baz/iota below ba<C>/iota
> - Third tab begins cycling bar/iota/ and baz/iota/
> 

That's exactly what I see, too.  Sorry for my inaccuracy.

> } % mkdir -p {10a,11a}/iota
> } % cat 1/i<CURSOR>
> } [press <TAB>]
> } % cat 1<CURSOR>a/iota
> } [press <TAB>]
> } % cat 1a/iota<CURSOR>
> } [stays the same upon pressing TAB]
> } 
> } I expected the second <TAB> press to offer me the possible completions
> } '10a' '11a'.
> 
> With only glob_complete, it works by appending a * to the end of the word,
> not by inserting a * at the cursor position.  1a*/iota* doesn't match
> anything.
> 
> Any time the cursor is left in the middle of a word, it means that the
> completion system is waiting for you to type a disambiguating character.
> 

Okay.

> } I'd at least like not to be left with "1a/iota<CURSOR>"
> 
> It's supposed to be sufficient to "setopt completeinword" to get the
> behavior you want, and indeed it works if I literally type out
> 
> % cat 1a/iota
> 
> and then move the cursor to 1<C>a/iota before pressing TAB.

It seems to work if I use <Left-arrow> to move the cursor, but not if
I use <M-b> to move the cursor.  Details:

If I type "cat 1a/iota<Left><Left><Left><Left><Left><Left><TAB>", I get
"10a/iota" and "11a/iota" offered below the input line (as in the second
<TAB> press in your description).

However, if I type "cat 1a/iota<M-b><Left><Left><TAB>", nothing happens,
even if I press <TAB> a few more times.

This is in XTerm(278) with TERM=xterm on Debian.  I invoked xterm as
   xterm -xrm 'XTerm*eightBitInput: false'
.  Without that resource, it behaves the same way except <Esc><b> is
required instead of <M-b>.

> However,
> for some reason this doesn't happen when "continuing an in-progress
> completion" with a second TAB.  I believe that's because the second
> tab just regenerates the listing with the same pattern as on the
> first tab, and that's not sufficient to disambiguate.

Okay.  Any pointers on how to get started on a fix?  I tried to have
a look at the code, starting with expandoncomplete() (the C function),
but got lost.

Thanks,

Daniel


  reply	other threads:[~2015-03-19 23:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  7:32 Daniel Shahaf
2015-03-19  9:16 ` Mikael Magnusson
2015-03-19 23:15   ` Daniel Shahaf
2015-03-19 16:06 ` Bart Schaefer
2015-03-19 23:18   ` Daniel Shahaf [this message]
2015-03-20  1:21     ` Bart Schaefer
2015-03-20  4:16       ` Daniel Shahaf
2015-03-20  1:02   ` Bart Schaefer
2015-03-20  4:25     ` Daniel Shahaf
2015-03-20 16:41       ` 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=20150319231849.GD2653@tarsus.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@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).