zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Fun with zsh (Re: Associative array ordering (Re: Example function))
Date: Tue, 2 Feb 1999 13:26:53 +0100 (MET)	[thread overview]
Message-ID: <199902021226.NAA09121@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Tue, 2 Feb 1999 04:10:27 -0800


Bart Schaefer wrote:

> On Feb 2,  3:59am, Bart Schaefer wrote:
> } Subject: Re: Fun with zsh (Re: Associative array ordering (Re: Example fun
> }
> } On Feb 2, 12:42pm, Helmut Jarausch wrote:
> } } array> '(*.bz)AIcons-1.5.tar.bz2bzip -dc'
> } }               ^^^^^^^^^^^^^^^^^^   where does this come from?
> } 
> } If you did cut and paste, that's showing up because there's a tab
> } 
> } That's obviously wrong here in more ways than one, and in fact my own
> } just-compiled copy of zsh dumps core when I do the same thing.
> 
> I think this fixes it; at least, it prevents my crash, but I'm not sure
> it's otherwise correct.  Help, Sven!

[I was just writing my answer to Bart's previous message when this
came, a few seconds later...]

> -    char *s = findcmd(cmdstr, 1);
> +    char *s = incmd ? findcmd(cmdstr, 1) : os;

`incmd' is non-zero if we are completing the command string itself
(first word). So this would make `pattern compctl's be correctly
lookup up only when completing that.

Use the one below instead, which avoids using `pattern compctl's if we 
are not completing a for a normal command.

In the previous message Bart wrote:

> That's obviously wrong here in more ways than one, and in fact my own
> just-compiled copy of zsh dumps core when I do the same thing.

I'm not sure, in which ways zsh is wrong to do completion here. After
all, it gets TABs. And even inside array values completion may be
useful, don't you think?


Bye
 Sven

--- os/Zle/zle_tricky.c	Mon Feb  1 10:54:28 1999
+++ Src/Zle/zle_tricky.c	Tue Feb  2 13:18:02 1999
@@ -3667,10 +3667,11 @@
     }
     /* Then search the pattern compctls, with the command name and the *
      * full pathname of the command. */
-    makecomplistpc(os, incmd);
-    if (!(ccont & CC_CCCONT))
-	return;
-
+    if (cmdstr) {
+	makecomplistpc(os, incmd);
+	if (!(ccont & CC_CCCONT))
+	    return;
+    }
     /* If the command string starts with `=', try the path name of the *
      * command. */
     if (cmdstr && cmdstr[0] == Equals) {

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~1999-02-02 12:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-02 12:26 Sven Wischnowsky [this message]
1999-02-02 16:54 ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
1999-02-05  8:58 Sven Wischnowsky
1999-02-05  7:45 Sven Wischnowsky
1999-02-04  8:06 Sven Wischnowsky
1999-02-04 16:11 ` Bart Schaefer
1999-02-03 15:00 Sven Wischnowsky
1999-02-03 17:38 ` Bart Schaefer
1999-02-03 10:41 Sven Wischnowsky
1999-02-02 17:19 Sven Wischnowsky
1999-02-02 17:48 ` Bart Schaefer
     [not found] <jarausch-990202124256.A09694@numa1>
1999-02-02 11:59 ` Bart Schaefer
1999-02-02 12:10   ` Bart Schaefer
1999-02-02  8:01 Associative array ordering and selective unset (Re: Example function) Sven Wischnowsky
1999-02-02 11:31 ` Fun with zsh (Re: Associative array ordering (Re: Example function)) 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=199902021226.NAA09121@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.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).