zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@sunsite.auc.dk
Subject: Re: some notes on 3.1.6
Date: Mon, 30 Aug 1999 13:53:07 +0200	[thread overview]
Message-ID: <9908301153.AA17018@ibmth.df.unipi.it> (raw)
In-Reply-To: "Sven Wischnowsky"'s message of "Thu, 19 Aug 1999 13:23:37 DFT." <199908191123.NAA18221@beta.informatik.hu-berlin.de>

Sven Wischnowsky wrote:
> .. but requiring that all
> widgets they want to bind have to be defined by the user first is a
> bit too much, I think

But they don't have to be defined first.

% bindkey '^[OS' foobar
% bindkey '^[OR' whatever
% foobar() { whatever() { LBUFFER="${LBUFFER}x" }; zle -N whatever; }
% zle -N foobar

works as expected (S-F12 then S-F11 on my keyboard adds an 'x', without
`whatever' being defined when I bound it.  Unless I've missed the point.

> The
> AUTO_PARAM_SLASH problem was already mentioned (the problem is that we 
> made such parameter completions be handled almost completely in shell
> code, so we would have to add the slashes there, too, which is a bit
> slowish).

I've actually been doing the following and it's not so bad (it doesn't
actually use the option).  Maybe it could just blindly use the option, as
long as we mention the fact that it may be slow.  Maybe there's a way of
enhancing compadd to get it to work easily: some form of the -f option
which takes an array argument giving to the actual files to test instead
of using the normal arguments?


#compdef -parameter-

setopt localoptions extendedglob

local p pms dirlist normlist
#pms=(${${${${(f)"$(typeset +)"}:#*local *\=*}##* }:/^$PREFIX*$SUFFIX})
_parameters -O pms

for p in $pms; do
  if [[ -d ${(P)p} ]]; then
    dirlist=($dirlist $p)
  else
    normlist=($normlist $p)
  fi
done

(( #dirlist )) && compadd -S / -q $dirlist
(( #normlist )) && compadd $normlist

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


  reply	other threads:[~1999-08-30 14:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-19 11:23 Sven Wischnowsky
1999-08-30 11:53 ` Peter Stephenson [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-08-31  8:37 Sven Wischnowsky
1999-08-19  8:46 Zefram
1999-08-24 14:02 ` Peter Stephenson

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=9908301153.AA17018@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).