zsh-workers
 help / color / mirror / code / Atom feed
* bash comp env missing
@ 2013-01-04 12:32 Frank Becker
  2013-01-04 13:06 ` Peter Stephenson
  0 siblings, 1 reply; 6+ messages in thread
From: Frank Becker @ 2013-01-04 12:32 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]

Hi,

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?

Thanks,

	Frank

-- 
Frank Becker <fb@alien8.de> (jabber|mail) | http://twitter.com/41i3n8
GnuPG: 0xADC29ECD | F01B 5E9C 1D09 981B 5B40 50D3 C80F 7459 ADC2 9ECD


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 203 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bash comp env missing
  2013-01-04 12:32 bash comp env missing Frank Becker
@ 2013-01-04 13:06 ` Peter Stephenson
  2013-01-04 15:48   ` Frank Becker
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Stephenson @ 2013-01-04 13:06 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bash comp env missing
  2013-01-04 13:06 ` Peter Stephenson
@ 2013-01-04 15:48   ` Frank Becker
  2013-01-04 15:55     ` Peter Stephenson
  2013-01-04 15:59     ` Jens Kubieziel
  0 siblings, 2 replies; 6+ messages in thread
From: Frank Becker @ 2013-01-04 15:48 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]


On 04.01.2013, at 14:06, Peter Stephenson <p.stephenson@samsung.com> wrote:

Hi Peter,

> 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.
>> 
[…]

>> 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
Right, that's what I tried. I didn't know about the -x switch for local.
Thanks.

OK, so it should be fixed in bashcompinit. Do you send that patch?

Thanks,

	Frank

-- 
Frank Becker <fb@alien8.de> (jabber|mail) | http://twitter.com/41i3n8
GnuPG: 0xADC29ECD | F01B 5E9C 1D09 981B 5B40 50D3 C80F 7459 ADC2 9ECD


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 203 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bash comp env missing
  2013-01-04 15:48   ` Frank Becker
@ 2013-01-04 15:55     ` Peter Stephenson
  2013-01-04 15:59     ` Jens Kubieziel
  1 sibling, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2013-01-04 15:55 UTC (permalink / raw)
  To: zsh-workers

On Fri, 04 Jan 2013 16:48:11 +0100
Frank Becker <fb@alien8.de> wrote:
> Right, that's what I tried. I didn't know about the -x switch for
> local. Thanks.
> 
> OK, so it should be fixed in bashcompinit. Do you send that patch?

I've committed it.

pws


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bash comp env missing
  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
  1 sibling, 1 reply; 6+ messages in thread
From: Jens Kubieziel @ 2013-01-04 15:59 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

* Frank Becker schrieb am 2013-01-04 um 16:48 Uhr:
> OK, so it should be fixed in bashcompinit. Do you send that patch?

http://zsh.cvs.sourceforge.net/viewvc/zsh/zsh/Completion/bashcompinit?r1=1.5&r2=1.6

-- 
Jens Kubieziel                                   http://www.kubieziel.de

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: bash comp env missing
  2013-01-04 15:59     ` Jens Kubieziel
@ 2013-01-04 22:25       ` Frank Becker
  0 siblings, 0 replies; 6+ messages in thread
From: Frank Becker @ 2013-01-04 22:25 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

On 04.01.2013, at 16:59, Jens Kubieziel <maillist@kubieziel.de> wrote:

> * Frank Becker schrieb am 2013-01-04 um 16:48 Uhr:

Hi,

Peter, many thanks!

>> OK, so it should be fixed in bashcompinit. Do you send that patch?
> 
> http://zsh.cvs.sourceforge.net/viewvc/zsh/zsh/Completion/bashcompinit?r1=1.5&r2=1.6

Thank you Jens. 

There is also a copy on github (as you probably know):

https://github.com/zsh-users/zsh/commit/edab1d3dbe61da7efe5f1ac0e40444b2ec9b9570


Bye,

	Frank
-- 
Frank Becker <fb@alien8.de> (jabber|mail) | http://twitter.com/41i3n8
GnuPG: 0xADC29ECD | F01B 5E9C 1D09 981B 5B40 50D3 C80F 7459 ADC2 9ECD


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 203 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-01-04 22:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-04 12:32 bash comp env missing Frank Becker
2013-01-04 13:06 ` Peter Stephenson
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

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).