zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bug#497663: Tab completion for vim is broken
@ 2008-09-16 11:49 Wesley Schwengle
  2008-09-16 17:23 ` Wesley Schwengle
  0 siblings, 1 reply; 9+ messages in thread
From: Wesley Schwengle @ 2008-09-16 11:49 UTC (permalink / raw)
  To: zsh-workers, Arto Jantunen, 497663



On 04.09.08 13:44 Frank Terbeck wrote:

> Clint Adams <schizo@debian.org>:
>> On Thu, Sep 04, 2008 at 12:05:05PM +0300, Arto Jantunen wrote:
>>>>> Typing vim and pressing tab produces the following output:
>>>>> 
>>>>> _vim:31: unmatched '
>>>>> 
>>>>> Commenting out lines 31-40 in
>>>>> /usr/share/zsh/functions/Completion/Unix/_vim fixes the problem. Should
>>>>> be trivial to fix properly for someone who understands zsh's compeltion
>>>>> syntax (I don't).
>>>> 
>>>> I can't reproduce this and I don't see what the problem might be.
>>>> Is this consistent for you?
>>> 
>>> Hmm. Apparently it depends on "emulate csh" being used. I can't
>>> reproduce with a .zshrc of only
>>> 
>>> autoload -U compinit
>>> compinit
>>> 
>>> But can after adding emulate csh above those lines.
>> 
>> Anyone know which option might be the culprit here?
> 
> Yes, 'csh_junkie_quotes'.
> 
> The problem will vanish, if you unset that option after your 'emulate
> csh' call.
> 
> However, I thought 'setopt no_csh_junkie_quotes' or 'emulate -L' at
> the start of the file would be enough. But apparently it isn't...

I submitted a bugreport to Ubuntu about this issue:

https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/264644

The bugreport includes patches for vim, less and diff_options.

I also have setopt CSHJUNKIEQUOTES enabled in my .zshrc..

Cheers,
Wesley


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

* Re: Bug#497663: Tab completion for vim is broken
  2008-09-16 11:49 Bug#497663: Tab completion for vim is broken Wesley Schwengle
@ 2008-09-16 17:23 ` Wesley Schwengle
  0 siblings, 0 replies; 9+ messages in thread
From: Wesley Schwengle @ 2008-09-16 17:23 UTC (permalink / raw)
  To: zsh-workers, Arto Jantunen, 497663

On 16.09.08 13:49 Wesley Germaine Schwengle wrote:

> I submitted a bugreport to Ubuntu about this issue:
>
> https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/264644
>
> The bugreport includes patches for vim, less and diff_options.
>
> I also have setopt CSHJUNKIEQUOTES enabled in my .zshrc..

On zsh version 4.3.2 the autocompletion is working without the need to patch
the completion files.

The bug is introduced in either 4.3.3 or 4.3.4.

Cheers,
Wesley


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

* Re: Bug#497663: Tab completion for vim is broken
  2008-09-04 12:06       ` Frank Terbeck
@ 2008-09-04 16:07         ` Bart Schaefer
  0 siblings, 0 replies; 9+ messages in thread
From: Bart Schaefer @ 2008-09-04 16:07 UTC (permalink / raw)
  To: zsh-workers

On Sep 4,  2:06pm, Frank Terbeck wrote:
}
} But I don't understand, why this is not enough:
} 
} +emulate -L zsh
} +

The reason is that the eumulate doesn't take effect until the function
is executed, whereas the quoting error is returned at the time the
function is parsed.  "emulate" does not work like a perl "use" pragma.

Even PWS's _comp_setup change won't do any good if _vim somehow gets
autoloaded before _main_complete begins executing.  Unlikely, but ...


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

* Re: Bug#497663: Tab completion for vim is broken
  2008-09-04 10:03     ` Clint Adams
                         ` (3 preceding siblings ...)
  2008-09-04 12:37       ` Peter Stephenson
@ 2008-09-04 14:29       ` Bart Schaefer
  4 siblings, 0 replies; 9+ messages in thread
From: Bart Schaefer @ 2008-09-04 14:29 UTC (permalink / raw)
  To: Clint Adams, zsh-workers; +Cc: Arto Jantunen, 497663

On Sep 4, 10:03am, Clint Adams wrote:
} Subject: Re: Bug#497663: Tab completion for vim is broken
}
} On Thu, Sep 04, 2008 at 12:05:05PM +0300, Arto Jantunen wrote:
} > >> Typing vim and pressing tab produces the following output:
} > >> 
} > >> _vim:31: unmatched '
} > 
} > Hmm. Apparently it depends on "emulate csh" being used.
} 
} Anyone know which option might be the culprit here?

Line 31 of _vim is a single-quoted string that spans multiple lines.

So CSH_JUNKIE_QUOTES is almost certainly at fault.


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

* Re: Bug#497663: Tab completion for vim is broken
  2008-09-04 10:03     ` Clint Adams
                         ` (2 preceding siblings ...)
  2008-09-04 12:29       ` Jun T.
@ 2008-09-04 12:37       ` Peter Stephenson
  2008-09-04 14:29       ` Bart Schaefer
  4 siblings, 0 replies; 9+ messages in thread
From: Peter Stephenson @ 2008-09-04 12:37 UTC (permalink / raw)
  To: zsh-workers, Arto Jantunen, 497663

Clint Adams wrote:
> On Thu, Sep 04, 2008 at 12:05:05PM +0300, Arto Jantunen wrote:
> > >> Typing vim and pressing tab produces the following output:
> > >> 
> > >> _vim:31: unmatched '
> > >> 
> > >> Commenting out lines 31-40 in
> > >> /usr/share/zsh/functions/Completion/Unix/_vim fixes the problem. Should
> > >> be trivial to fix properly for someone who understands zsh's compeltion
> > >> syntax (I don't).
> > >
> > > I can't reproduce this and I don't see what the problem might be.
> > > Is this consistent for you?
> > 
> > Hmm. Apparently it depends on "emulate csh" being used. I can't
> > reproduce with a .zshrc of only
> > 
> > autoload -U compinit
> > compinit
> > 
> > But can after adding emulate csh above those lines.
> 
> Anyone know which option might be the culprit here?

csh_junkie_quotes

--- ../zsh-debug/zsh/Completion/compinit	2008-06-06 17:43:35.000000000 +0100
+++ Completion/compinit	2008-09-04 13:34:21.000000000 +0100
@@ -139,6 +139,7 @@
     NO_allexport
     NO_aliases
     NO_cshnullglob
+    NO_cshjunkiequotes
     NO_errexit
     NO_globsubst
     NO_histsubstpattern


-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


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

* Re: Bug#497663: Tab completion for vim is broken
  2008-09-04 10:03     ` Clint Adams
  2008-09-04 11:44       ` Frank Terbeck
  2008-09-04 12:06       ` Frank Terbeck
@ 2008-09-04 12:29       ` Jun T.
  2008-09-04 12:37       ` Peter Stephenson
  2008-09-04 14:29       ` Bart Schaefer
  4 siblings, 0 replies; 9+ messages in thread
From: Jun T. @ 2008-09-04 12:29 UTC (permalink / raw)
  To: zsh-workers

At 10:03 AM +0000 08.9.4, Clint Adams wrote:
>Anyone know which option might be the culprit here?

I guess it's CSH_JUNKIE_QUOTES.



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

* Re: Bug#497663: Tab completion for vim is broken
  2008-09-04 10:03     ` Clint Adams
  2008-09-04 11:44       ` Frank Terbeck
@ 2008-09-04 12:06       ` Frank Terbeck
  2008-09-04 16:07         ` Bart Schaefer
  2008-09-04 12:29       ` Jun T.
                         ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Frank Terbeck @ 2008-09-04 12:06 UTC (permalink / raw)
  To: zsh-workers

Clint Adams <schizo@debian.org>:
> On Thu, Sep 04, 2008 at 12:05:05PM +0300, Arto Jantunen wrote:
> > >> Typing vim and pressing tab produces the following output:
> > >> 
> > >> _vim:31: unmatched '
> > >> 
> > >> Commenting out lines 31-40 in
> > >> /usr/share/zsh/functions/Completion/Unix/_vim fixes the problem. Should
> > >> be trivial to fix properly for someone who understands zsh's compeltion
> > >> syntax (I don't).
> > >
> > > I can't reproduce this and I don't see what the problem might be.
> > > Is this consistent for you?
> > 
> > Hmm. Apparently it depends on "emulate csh" being used. I can't
> > reproduce with a .zshrc of only
> > 
> > autoload -U compinit
> > compinit
> > 
> > But can after adding emulate csh above those lines.
> 
> Anyone know which option might be the culprit here?


This does the trick:

diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim
index 684e027..da9295b 100644
--- a/Completion/Unix/Command/_vim
+++ b/Completion/Unix/Command/_vim
@@ -28,15 +31,15 @@ arguments=(
   '-C[make vim compatible with vi]'
   '-N[do not force compatibility with vi]'
   '(--nofork -f)'{--nofork,-f}'[do not detach the GUI version from the shell]'
-  '-V-[verbosity level]::verbosity:((0\:"do not display any messages"
-                                     1\:"display when viminfo file is read or written"
-                                     2\:"display sourced files"
-                                     5\:"display every searched tag-file"
-                                     8\:"display files that trigger autocommands"
-                                     9\:"display every triggered autocommand (default)"
-                                    12\:"display every executed function"
-                                    13\:"report every thrown, caught, finished, or discarded exception"
-                                    14\:"display anything pending in a \:finally clause"
+  '-V-[verbosity level]::verbosity:((0\:"do not display any messages" \
+                                     1\:"display when viminfo file is read or written" \
+                                     2\:"display sourced files" \
+                                     5\:"display every searched tag-file" \
+                                     8\:"display files that trigger autocommands" \
+                                     9\:"display every triggered autocommand (default)" \
+                                    12\:"display every executed function" \
+                                    13\:"report every thrown, caught, finished, or discarded exception" \
+                                    14\:"display anything pending in a \:finally clause" \
                                     15\:"display every executed ex-command"))'
   '-D[debugging mode]'
   '-n[no swap file (memory only)]'


But I don't understand, why this is not enough:

diff --git a/Completion/Unix/Command/_vim b/Completion/Unix/Command/_vim
index 684e027..44a317d 100644
--- a/Completion/Unix/Command/_vim
+++ b/Completion/Unix/Command/_vim
@@ -1,5 +1,7 @@
 #compdef vim exim gvim gex gview rvim rview rgvim rgview evim eview vimdiff gvimdiff
 
+emulate -L zsh
+
 (( $+functions[_vim_files] )) ||
 _vim_files () {
   case $PREFIX in

Regards, Frank


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

* Re: Bug#497663: Tab completion for vim is broken
  2008-09-04 10:03     ` Clint Adams
@ 2008-09-04 11:44       ` Frank Terbeck
  2008-09-04 12:06       ` Frank Terbeck
                         ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Frank Terbeck @ 2008-09-04 11:44 UTC (permalink / raw)
  To: zsh-workers, Arto Jantunen, 497663

Clint Adams <schizo@debian.org>:
> On Thu, Sep 04, 2008 at 12:05:05PM +0300, Arto Jantunen wrote:
> > >> Typing vim and pressing tab produces the following output:
> > >> 
> > >> _vim:31: unmatched '
> > >> 
> > >> Commenting out lines 31-40 in
> > >> /usr/share/zsh/functions/Completion/Unix/_vim fixes the problem. Should
> > >> be trivial to fix properly for someone who understands zsh's compeltion
> > >> syntax (I don't).
> > >
> > > I can't reproduce this and I don't see what the problem might be.
> > > Is this consistent for you?
> > 
> > Hmm. Apparently it depends on "emulate csh" being used. I can't
> > reproduce with a .zshrc of only
> > 
> > autoload -U compinit
> > compinit
> > 
> > But can after adding emulate csh above those lines.
> 
> Anyone know which option might be the culprit here?

Yes, 'csh_junkie_quotes'.

The problem will vanish, if you unset that option after your 'emulate
csh' call.

However, I thought 'setopt no_csh_junkie_quotes' or 'emulate -L' at
the start of the file would be enough. But apparently it isn't...

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


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

* Re: Bug#497663: Tab completion for vim is broken
       [not found]   ` <87prnk703i.fsf_-_@debian.org>
@ 2008-09-04 10:03     ` Clint Adams
  2008-09-04 11:44       ` Frank Terbeck
                         ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Clint Adams @ 2008-09-04 10:03 UTC (permalink / raw)
  To: zsh-workers; +Cc: Arto Jantunen, 497663

On Thu, Sep 04, 2008 at 12:05:05PM +0300, Arto Jantunen wrote:
> >> Typing vim and pressing tab produces the following output:
> >> 
> >> _vim:31: unmatched '
> >> 
> >> Commenting out lines 31-40 in
> >> /usr/share/zsh/functions/Completion/Unix/_vim fixes the problem. Should
> >> be trivial to fix properly for someone who understands zsh's compeltion
> >> syntax (I don't).
> >
> > I can't reproduce this and I don't see what the problem might be.
> > Is this consistent for you?
> 
> Hmm. Apparently it depends on "emulate csh" being used. I can't
> reproduce with a .zshrc of only
> 
> autoload -U compinit
> compinit
> 
> But can after adding emulate csh above those lines.

Anyone know which option might be the culprit here?


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

end of thread, other threads:[~2008-09-16 17:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-16 11:49 Bug#497663: Tab completion for vim is broken Wesley Schwengle
2008-09-16 17:23 ` Wesley Schwengle
     [not found] <20080903130432.9601.64807.reportbug@ryoko>
     [not found] ` <20080903182826.GB7955@scru.org>
     [not found]   ` <87prnk703i.fsf_-_@debian.org>
2008-09-04 10:03     ` Clint Adams
2008-09-04 11:44       ` Frank Terbeck
2008-09-04 12:06       ` Frank Terbeck
2008-09-04 16:07         ` Bart Schaefer
2008-09-04 12:29       ` Jun T.
2008-09-04 12:37       ` Peter Stephenson
2008-09-04 14:29       ` Bart Schaefer

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