zsh-workers
 help / color / mirror / code / Atom feed
From: Travis Spencer <tspencer@cs.pdx.edu>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: _unexpand
Date: Sun, 10 Jul 2005 17:52:17 -0700	[thread overview]
Message-ID: <20050711005217.GB12208@ruby.cat.pdx.edu> (raw)
In-Reply-To: <1050710162010.ZM24203@candle.brasslantern.com>

On Sun, Jul 10, 2005 at 04:20:10PM +0000, Bart Schaefer wrote:
> Try "unset _cmd_variant" right after you change your path, to clear the
> _pick_variant cache.

Ya, that did it.  I guess the use of _pick_variant will work, but IMO
rehash should invalidate the cache that _pick_variant is hanging onto.
I've aliased rehash to `rehash && unset _cmd_variant', so I don't get
bit by that one again.

Here is a patch that uses _pick_variant instead:

--- /dev/null	Sun Jul 10 17:44:10 2005
+++ Completion/Unix/Command/_unexpand	Sun Jul 10 17:32:36 2005
@@ -0,0 +1,42 @@
+#compdef unexpand
+#
+# $Id:$
+#
+# Copyright (C) 2005 Travis L. Spencer
+# ALL RIGHTS RESERVED
+#
+# See the file LICENCE in the root of the zsh distribution for
+# licensing information.
+#
+
+local all tabs ret=1
+local -a args
+
+all="convert all whitespace, instead of just initial whitespace"
+tabs="use comma separated list of tab positions"
+args=( 
+    "(--all)-a[$all]"
+    "(--tabs)-t[$tabs]:tablist"
+    "*:file:_files"
+)
+
+if _pick_variant gnu="Free Soft" unix --version; then
+    args+=(
+        "(-a)--all[$all]"
+        "--first-only[convert only leading sequences of whitespace]"
+        "(-t)--tabs=[$tabs]:tablist"
+        "(* -)--help[display help message and exit]"
+        "(* -)--version[output version information and exit]"
+    )
+fi
+
+_arguments "$args[@]" && ret=0
+
+return ret
+
+: <<EMACS_LOCAL_VARIABLES
+Local Variables:
+mode: shell-script
+mode: flyspell-prog
+End:
+EMACS_LOCAL_VARIABLES


  reply	other threads:[~2005-07-11  0:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-10  1:18 Travis Spencer
2005-07-10  3:38 ` Bart Schaefer
2005-07-10  6:14   ` Travis Spencer
2005-07-10 16:20     ` Bart Schaefer
2005-07-11  0:52       ` Travis Spencer [this message]
2005-07-11  3:26         ` 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=20050711005217.GB12208@ruby.cat.pdx.edu \
    --to=tspencer@cs.pdx.edu \
    --cc=zsh-workers@sunsite.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).