zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: Mac-arena the Bored Zo <macrulez@softhome.net>,
	zsh-workers@sunsite.dk (Zsh hackers list)
Subject: Re: email to zsh
Date: Wed, 06 Jul 2005 10:50:25 +0100	[thread overview]
Message-ID: <200507060950.j669oQlo014789@news01.csr.com> (raw)
In-Reply-To: <200507011444.j61EiuMN021566@news01.csr.com>

Peter Stephenson wrote:
> I can get this now.  From zsh -f, any recent version, in an empty
> directory:
> 
> files=(AIWebKitMessageViewController.m
> AIWebKitMessageViewPlugin.m
> AIWebkitMessageViewStyle.m)
> touch $files
> chmod +x *.m
> compctl -M '' 'm:{a-zA-Z}={A-Za-z}'
> ./AIWebKitMessagep
> 
> then TAB will cause it to happen.  I think the compctl -M is the key:
> it's somewhere in the hairy matcher code.

This seems to fix the problem, and allow the completion to work as
expected, though I haven't a clue what the code I've fixed is doing.

Index: Src/Zle/compmatch.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compmatch.c,v
retrieving revision 1.42
diff -u -r1.42 compmatch.c
--- Src/Zle/compmatch.c	4 Jun 2004 06:00:40 -0000	1.42
+++ Src/Zle/compmatch.c	6 Jul 2005 09:47:39 -0000
@@ -803,14 +803,26 @@
 		    /* Probably add the matched strings. */
 		    if (!test) {
 			if (sfx)
-			    add_match_str(NULL, NULL, w, ow - w, sfx);
+			{
+			    if (ow >= w)
+				add_match_str(NULL, NULL, w, ow - w, sfx);
+			}
 			else
-			    add_match_str(NULL, NULL, ow, w - ow, sfx);
+			{
+			    if (w >= ow)
+				add_match_str(NULL, NULL, ow, w - ow, sfx);
+			}
 			add_match_str(mp, tl, tw, mp->wlen, sfx);
 			if (sfx)
-			    add_match_sub(NULL, NULL, 0, w, ow - w);
+			{
+			    if (ow >= w)
+				add_match_sub(NULL, NULL, 0, w, ow - w);
+			}
 			else
-			    add_match_sub(NULL, NULL, 0, ow, w - ow);
+			{
+			    if (w >= ow)
+				add_match_sub(NULL, NULL, 0, ow, w - ow);
+			}
 			add_match_sub(mp, tl, mp->llen, tw, mp->wlen);
 		    }
 		    if (sfx) {

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

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


  reply	other threads:[~2005-07-06  9:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-29  4:26 [UNFINISHED] " Mac-arena the Bored Zo
2005-06-29 10:15 ` Peter Stephenson
2005-06-29 10:28   ` Mac-arena the Bored Zo
2005-06-29 11:39     ` Peter Stephenson
2005-06-29 13:03       ` Mac-arena the Bored Zo
2005-07-01 14:44 ` Peter Stephenson
2005-07-06  9:50   ` Peter Stephenson [this message]
2005-07-06 15:41     ` Bart Schaefer
2005-07-06 15:56       ` Peter Stephenson
2005-07-07  8:07         ` Felix Rosencrantz

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=200507060950.j669oQlo014789@news01.csr.com \
    --to=pws@csr.com \
    --cc=macrulez@softhome.net \
    --cc=zsh-workers@sunsite.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).