zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] fix recursive ZLE from completion call
@ 2005-08-15 18:07 Andrey Borzenkov
  2005-08-15 18:22 ` Peter Stephenson
  2005-08-16 17:09 ` Andrey Borzenkov
  0 siblings, 2 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2005-08-15 18:07 UTC (permalink / raw)
  To: zsh-workers

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

That is becoming ridiculous. Any chance to have single entry point (wrapper?) 
for ZLE and completion functions?

Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.71
diff -u -p -r1.71 compcore.c
--- Src/Zle/compcore.c  10 Aug 2005 10:56:41 -0000      1.71
+++ Src/Zle/compcore.c  15 Aug 2005 18:04:45 -0000
@@ -353,8 +353,18 @@ do_completion(UNUSED(Hookdef dummy), Com
        clearlist = 1;
        ret = 1;
        minfo.cur = NULL;
-       if (useline < 0)
+       if (useline < 0) {
+           /* unmetafy line before calling ZLE */
+           int remetafy = 0;
+
+           if (zlemetaline != NULL) {
+               unmetafy_line();
+               remetafy = 1;
+           }
            ret = selfinsert(zlenoargs);
+           if (remetafy)
+               metafy_line();
+       }
        goto compend;
     }
     zsfree(lastprebr);
@@ -367,9 +377,18 @@ do_completion(UNUSED(Hookdef dummy), Com
        if (nmatches)
             do_ambig_menu();
        ret = !nmatches;
-    } else if (useline < 0)
+    } else if (useline < 0) {
+       /* unmetafy line before calling ZLE */
+       int remetafy = 0;
+
+       if (zlemetaline != NULL) {
+           unmetafy_line();
+           remetafy = 1;
+       }
        ret = selfinsert(zlenoargs);
-    else if (!useline && uselist) {
+       if (remetafy)
+           metafy_line();
+    } else if (!useline && uselist) {
        /* All this and the guy only wants to see the list, sigh. */
        zlemetacs = 0;
        foredel(zlemetall);

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

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

* Re: [PATCH] fix recursive ZLE from completion call
  2005-08-15 18:07 [PATCH] fix recursive ZLE from completion call Andrey Borzenkov
@ 2005-08-15 18:22 ` Peter Stephenson
  2005-08-16 17:09 ` Andrey Borzenkov
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2005-08-15 18:22 UTC (permalink / raw)
  To: zsh-workers

Andrey Borzenkov wrote:
> That is becoming ridiculous. Any chance to have single entry point
> (wrapper?) for ZLE and completion functions?

If anybody understood the completion code well enough to do that, the
code would have been completely rewritten by now.

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


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


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

* Re: [PATCH] fix recursive ZLE from completion call
  2005-08-15 18:07 [PATCH] fix recursive ZLE from completion call Andrey Borzenkov
  2005-08-15 18:22 ` Peter Stephenson
@ 2005-08-16 17:09 ` Andrey Borzenkov
  1 sibling, 0 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2005-08-16 17:09 UTC (permalink / raw)
  To: zsh-workers

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

No need for extra checks, we know for sure we are inside of completion.

Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.74
diff -u -p -r1.74 compcore.c
--- Src/Zle/compcore.c  16 Aug 2005 01:59:43 -0000      1.74
+++ Src/Zle/compcore.c  16 Aug 2005 17:08:26 -0000
@@ -355,15 +355,9 @@ do_completion(UNUSED(Hookdef dummy), Com
        minfo.cur = NULL;
        if (useline < 0) {
            /* unmetafy line before calling ZLE */
-           int remetafy = 0;
-
-           if (zlemetaline != NULL) {
-               unmetafy_line();
-               remetafy = 1;
-           }
+           unmetafy_line();
            ret = selfinsert(zlenoargs);
-           if (remetafy)
-               metafy_line();
+           metafy_line();
        }
        goto compend;
     }
@@ -379,15 +373,9 @@ do_completion(UNUSED(Hookdef dummy), Com
        ret = !nmatches;
     } else if (useline < 0) {
        /* unmetafy line before calling ZLE */
-       int remetafy = 0;
-
-       if (zlemetaline != NULL) {
-           unmetafy_line();
-           remetafy = 1;
-       }
+       unmetafy_line();
        ret = selfinsert(zlenoargs);
-       if (remetafy)
-           metafy_line();
+       metafy_line();
     } else if (!useline && uselist) {
        /* All this and the guy only wants to see the list, sigh. */
        zlemetacs = 0;

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

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

end of thread, other threads:[~2005-08-16 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-15 18:07 [PATCH] fix recursive ZLE from completion call Andrey Borzenkov
2005-08-15 18:22 ` Peter Stephenson
2005-08-16 17:09 ` Andrey Borzenkov

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