zsh-workers
 help / color / mirror / code / Atom feed
From: Peter William Stephenson <pws@ifh.de>
To: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: Alias fix
Date: Wed, 15 Nov 1995 16:32:17 +0100	[thread overview]
Message-ID: <9511151532.AA00841@sgi.ifh.de> (raw)

I've wasted the whole day fixing bugs, there's no point doing
anything useful now:

This fixes this problem I've just reported:

% alias foo='echo '
% foo bar
bar
% <up-arrow>	->	% foo  bar

(extra spaces being inserted).  The fix is deliberately restrictive so
as not to cause knock-on problems.

*** Src/hist.c.sp	Wed Nov 15 14:29:01 1995
--- Src/hist.c	Wed Nov 15 16:29:55 1995
***************
*** 686,691 ****
--- 686,701 ----
  	alstat = 0;
  }
  
+ /* Go back to immediately after the last word, skipping space. */
+ 
+ /**/
+ void
+ histbackword(void)
+ {
+     if (!(chwordpos%2) && chwordpos)
+ 	hptr = chline + chwords[chwordpos-1];
+ }
+ 
  /* Get the start and end point of the current history word */
  
  /**/
*** Src/input.c.sp	Wed Nov 15 16:14:35 1995
--- Src/input.c	Wed Nov 15 16:22:30 1995
***************
*** 161,169 ****
  		/* a real alias:  mark it as unused. */
  		ix->inuse = 0;
  		t = ix->text;
! 		if (*t && t[strlen(t) - 1] == ' ')
  		    alstat = ALSTAT_MORE;
! 		else
  		    alstat = ALSTAT_JUNK;
  		inalpush(ix);
  	    }
--- 161,170 ----
  		/* a real alias:  mark it as unused. */
  		ix->inuse = 0;
  		t = ix->text;
! 		if (*t && t[strlen(t) - 1] == ' ') {
  		    alstat = ALSTAT_MORE;
! 		    histbackword();
! 		} else
  		    alstat = ALSTAT_JUNK;
  		inalpush(ix);
  	    }

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.


             reply	other threads:[~1995-11-15 15:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-11-15 15:32 Peter William Stephenson [this message]
  -- strict thread matches above, loose matches on Subject: below --
1995-11-15  5:32 beta12-test1 snapshot Richard Coleman
1995-11-15 14:58 ` Alias fix Peter William Stephenson

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=9511151532.AA00841@sgi.ifh.de \
    --to=pws@ifh.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).