zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: bash comp env missing
Date: Fri, 04 Jan 2013 13:06:43 +0000	[thread overview]
Message-ID: <20130104130643.15e02307@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <EA715998-F446-437C-9161-469C8FB72E1E@alien8.de>

On Fri, 04 Jan 2013 13:32:12 +0100
Frank Becker <fb@alien8.de> wrote:
> I am trying to use an external bash complete program using the
> bashcompinit auto completion function.
> 
> The external auto complete program needs the two environment variables
> 
> COMP_POINT
> export COMP_LINE
> 
> In zsh/functions/bashcompinit those two variables are not exported.
> 
> If I add
> 	export COMP_POINT
> 	export COMP_LINE
> there everything works as expected.
> 
> Question: How do I use bashcompinit correctly so the external program
> can access the two environment variables?

It ought to be good enough to export them only from _bash_complete while
they are needed.

Index: Completion/bashcompinit
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/bashcompinit,v
retrieving revision 1.5
diff -p -u -r1.5 bashcompinit
--- Completion/bashcompinit	29 Jan 2012 18:23:54 -0000	1.5
+++ Completion/bashcompinit	4 Jan 2013 13:04:21 -0000
@@ -3,9 +3,9 @@
 _bash_complete() {
   local ret=1
   local -a suf matches
-  local COMP_POINT COMP_CWORD
+  local -x COMP_POINT COMP_CWORD
   local -a COMP_WORDS COMPREPLY BASH_VERSINFO
-  local COMP_LINE="$words"
+  local -x COMP_LINE="$words"
   local -A savejobstates savejobtexts
 
   (( COMP_POINT = 1 + ${#${(j. .)words[1,CURRENT]}} + $#QIPREFIX + $#IPREFIX + $#PREFIX ))

pws


  reply	other threads:[~2013-01-04 13:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-04 12:32 Frank Becker
2013-01-04 13:06 ` Peter Stephenson [this message]
2013-01-04 15:48   ` Frank Becker
2013-01-04 15:55     ` Peter Stephenson
2013-01-04 15:59     ` Jens Kubieziel
2013-01-04 22:25       ` Frank Becker

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=20130104130643.15e02307@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.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).