zsh-workers
 help / color / mirror / code / Atom feed
From: Zefram <zefram@dcs.warwick.ac.uk>
To: zsh-workers@math.gatech.edu (Z Shell workers mailing list)
Subject: history-search-*ward
Date: Sun, 5 Jan 1997 15:50:21 +0000 (GMT)	[thread overview]
Message-ID: <4164.199701051550@stone.dcs.warwick.ac.uk> (raw)

-----BEGIN PGP SIGNED MESSAGE-----

This patch makes history-search-{for,back}ward behave more like the
documentation says.  They search for lines starting with the same
complete word that the current line does, regardless of whether that
word is the complete line or not.  (The old undocumented type of search
can be obtained by using history-beginning-search-*ward.)  The existing
heuristics that reject target lines containing nothing other than the
word searched for are retained.

This patch must be applied on top of patch 2721, in place of patch 2724.

 -zefram

      *** Src/Zle/zle_hist.c	1997/01/04 17:47:26	1.6
      --- Src/Zle/zle_hist.c	1997/01/05 10:16:46
      ***************
      *** 344,356 ****
        void
        historysearchbackward(void)
        {
      !     int histpos, ohistline = histline;
            char *s;
        
            remember_edits();
      !     for (histpos = 0; histpos < ll && !iblank(line[histpos]); histpos++);
      !     if (histpos < ll)
      ! 	histpos++;
            for (;;) {
        	histline--;
        	if (!(s = zle_get_event(histline))) {
      --- 344,357 ----
        void
        historysearchbackward(void)
        {
      !     int histpos, histmpos, ohistline = histline;
            char *s;
        
            remember_edits();
      !     for (histpos = histmpos = 0; histpos < ll && !iblank(line[histpos]);
      ! 	histpos++, histmpos++)
      ! 	if(imeta(line[histpos]))
      ! 	    histmpos++;
            for (;;) {
        	histline--;
        	if (!(s = zle_get_event(histline))) {
      ***************
      *** 359,364 ****
      --- 360,366 ----
        	    return;
        	}
        	if (metadiffer(s, (char *) line, histpos) < 0 &&
      + 	    iblank(s[histmpos] == Meta ? s[histmpos+1]^32 : s[histmpos]) &&
        	    metadiffer(s, (char *) line, ll))
        	    break;
            }
      ***************
      *** 369,381 ****
        void
        historysearchforward(void)
        {
      !     int histpos, ohistline = histline;
            char *s;
        
            remember_edits();
      !     for (histpos = 0; histpos < ll && !iblank(line[histpos]); histpos++);
      !     if (histpos < ll)
      ! 	histpos++;
            for (;;) {
        	histline++;
        	if (!(s = zle_get_event(histline))) {
      --- 371,384 ----
        void
        historysearchforward(void)
        {
      !     int histpos, histmpos, ohistline = histline;
            char *s;
        
            remember_edits();
      !     for (histpos = histmpos = 0; histpos < ll && !iblank(line[histpos]);
      ! 	histpos++, histmpos++)
      ! 	if(imeta(line[histpos]))
      ! 	    histmpos++;
            for (;;) {
        	histline++;
        	if (!(s = zle_get_event(histline))) {
      ***************
      *** 384,389 ****
      --- 387,394 ----
        	    return;
        	}
        	if (metadiffer(s, (char *) line, histpos) < (histline == curhist) &&
      + 	    (!s[histmpos] ||
      + 	     iblank(s[histmpos] == Meta ? s[histmpos+1]^32 : s[histmpos])) &&
        	    metadiffer(s, (char *) line, ll))
        	    break;
            }

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMs+DPXD/+HJTpU/hAQHdxAQAkCX1cq89MwzhT1zPw6C5UC01CYtWZYYg
WqzaIIpSlmvM8ZfJlC9JWlK3oG35toElNiEujiHc5wK5vR90JnR3mSFzH0G1lM7O
W1MgPuqMHlVmNuwpnmzDl3d/BW1l7NI7LBPLvHW5O9zkRiR4Xy+OPh/gVqcLbkxg
GzccyzICq+A=
=wyKQ
-----END PGP SIGNATURE-----


                 reply	other threads:[~1997-01-05 15:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4164.199701051550@stone.dcs.warwick.ac.uk \
    --to=zefram@dcs.warwick.ac.uk \
    --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).