zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@math.gatech.edu
Subject: Re: experimental new style completion
Date: Thu, 21 Jan 1999 13:02:08 +0100 (MET)	[thread overview]
Message-ID: <199901211202.NAA19795@beta.informatik.hu-berlin.de> (raw)


Here is another little fixlet for the new style completion stuff. The
tokenizing in comp_str() failed for `$'s. Not wanting to change
tokenize() itself I added a little wrapper function in zle_tricky.c
(is there really no better way?).

Bye
 Sven

*** Src/Zle/zle_tricky.c.old	Thu Jan 21 12:59:33 1999
--- Src/Zle/zle_tricky.c	Thu Jan 21 12:58:27 1999
***************
*** 3348,3353 ****
--- 3348,3379 ----
      return 1;
  }
  
+ /* This should probably be moved into tokenize(). */
+ 
+ static char *
+ ctokenize(char *p)
+ {
+     char *r = p;
+     int bslash = 0;
+ 
+     tokenize(p);
+ 
+     for (p = r; *p; p++) {
+ 	if (*p == '\\')
+ 	    bslash = 1;
+ 	else {
+ 	    if (*p == '$') {
+ 		if (bslash)
+ 		    p[-1] = Bnull;
+ 		else
+ 		    *p = String;
+ 	    }
+ 	    bslash = 0;
+ 	}
+     }
+     return r;
+ }
+ 
  /**/
  char *
  comp_str(int *ipl, int *pl)
***************
*** 3358,3368 ****
      char *str;
      int lp, ls, lip;
  
!     tokenize(p);
      remnulargs(p);
!     tokenize(s);
      remnulargs(s);
!     tokenize(ip);
      remnulargs(ip);
      ls = strlen(s);
      lip = strlen(ip);
--- 3384,3394 ----
      char *str;
      int lp, ls, lip;
  
!     ctokenize(p);
      remnulargs(p);
!     ctokenize(s);
      remnulargs(s);
!     ctokenize(ip);
      remnulargs(ip);
      ls = strlen(s);
      lip = strlen(ip);

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


             reply	other threads:[~1999-01-21 12:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-21 12:02 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
1999-01-22 16:30 Sven Wischnowsky
1999-01-22 14:50 Sven Wischnowsky
1999-01-22 16:18 ` Phil Pennock
1999-01-22 17:09   ` Bart Schaefer
1999-01-22 13:15 Sven Wischnowsky
1999-01-21 16:07 Sven Wischnowsky
1999-01-21 10:53 Sven Wischnowsky
1999-01-21 10:36 Sven Wischnowsky
1999-01-07  8:02 Sven Wischnowsky
1999-01-05 15:43 Sven Wischnowsky
1999-01-07  7:36 ` Bart Schaefer
1998-12-18 15:59 Sven Wischnowsky

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=199901211202.NAA19795@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@math.gatech.edu \
    /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).