zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: PATCH: Remove _message call from _mkdir
Date: Sun, 12 Apr 2015 14:05:52 -0700	[thread overview]
Message-ID: <150412140552.ZM22795@torch.brasslantern.com> (raw)
In-Reply-To: <20150412205445.617e928c@ntlworld.com>

On Apr 12,  8:54pm, Peter Stephenson wrote:
}
} >        _wanted directories expl \
} >          'parent directory (alternatively specify name of directory)' \
} > -        _path_files -/ && ret=0 || _message 'name of directory'
} 
} I'm not really sure what that was doing there in this one case, anyway.

In the event that there really are no path prefixes to complete, it is
intended to change this:

torch% mkdir
No matches for `parent directory (alternatively specify name of directory)'

Into this:

torch% mkdir
name of directory

Trouble is there's no simple way to determine on the first call to _mkdir
whether there might be other paths suggested by later completers.

Hence my other suggestion from zsh-users:

> ...  Either that or it needs some option (the inverse
> of "_message -e"?) that tells _main_complete to continue even though a
> message is pending.

This is actually not too hard, just do not set _comp_mesg=yes, though the
option parsing for _message is unnecessarily ugly.  The doc for _message
says:

     ... the resulting string will
     always be shown whether or not matches were generated.

So with _comp_mesg not set, we'd potentially end up with:

torch% mkdir
name of directory
Completing parent directory (alternatively specify name of directory)
[list of the ignored files here]


      reply	other threads:[~2015-04-12 21:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5528B4C2.3010001@gmail.com>
     [not found] ` <150411134410.ZM27516@torch.brasslantern.com>
     [not found]   ` <5529A5C2.3090603@gmail.com>
     [not found]     ` <150412101826.ZM21679@torch.brasslantern.com>
2015-04-12 19:46       ` Bart Schaefer
2015-04-12 19:54         ` Peter Stephenson
2015-04-12 21:05           ` Bart Schaefer [this message]

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=150412140552.ZM22795@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).