zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Bruce Stephens <b.stephens@isode.com>, zsh-workers@math.gatech.edu
Subject: Re: up-line-or-search still 'fixed'!
Date: Tue, 9 Jun 1998 11:42:23 -0700	[thread overview]
Message-ID: <980609114223.ZM6613@candle.brasslantern.com> (raw)
In-Reply-To: <vbu35utvzk.fsf@snake.isode.com>

On Jun 9,  4:50pm, Bruce Stephens wrote:
} Subject: Re: up-line-or-search still 'fixed'!
}
} "Bart Schaefer" <schaefer@brasslantern.com> writes:
} 
} > If this were the IETF (which thank goodness it isn't, but) we'd take
} > a straw poll at this point.  So far I'm "hearing" a lot of protest
} > about this change from actual users of the shell and support only
} > from those interested in internal architecture.
} 
} Maybe somebody could summarise the specific question?

The question is, why did the behavior of up-line-or-search (and down-*)
change from zsh 3.0.x to zsh 3.1.x?

The answer is the same as the answer to the question, why did the behavior
of history-search-backward (and *-forward) change?

This isn't a "recent" change -- it took place in January 1997 -- but there
are several of us who've been protesting it all along.  It's come to a head
now because 3.0.5 now seems to really and truly be the final 3.0 release,
so soon there will be development/bugfixes only on 3.1.  If we're going to
continue using 3.1 and beyond, we need to resolve this issue.

} Maybe if the interface that's changed was described concisely,
} together with the reasons for changing it, then it would be obvious to
} people that it was worth keeping, or some workaround would become
} clearer?

It's pretty simple, really.

The 3.0 and earlier, history-search-*ward would record the length of the
search pattern and remember that the command was search.  When a second
history-search-*ward immediately followed, the current line up to the old
pattern length would be read and used as the search pattern.  Otherwise,
the current line up to the current cursor position -or- the end of the
first word (whichever came first) was read and used as the search pattern.
(Now loop back to the top of this paragraph.)

When user-defined widgets were introduced, the "old pattern length" or the
state of "was the last command a search" could become incorrect (that is,
things could change without the zle internals finding out all the details).
This meant that repeated backward searches could fail in unexpected ways.
To fix this, Zefram made two changes to history-search-*ward:  (1) they
ignore the cursor position and the previous pattern length, and (2) they
always search for an entire word matching the first entire word on the
current command line.

It's behavior (2) that we object to.  Those of us who use *-line-or-search,
which are implemented by calling history-search-*ward, were used to having
a *partial* word at the beginning of the current line matched against the
history.  It's significantly less useful if you must type the entire first
word before beginning the search.

We could reimplement *-line-or-search with history-beginning-search-*ward,
but there are two drawbacks to that:  (A) they won't stop reading the
pattern after the first word, they always read all the way to the cursor
position; (B) they won't reposition the cursor to the end of the line,
which history-search-*ward do (and can't, because the cursor position has
to remain unchanged for the next search to work correctly).  (A) is the
biggest problem.

It's my assertion that history-search-*ward are now broken and should be
made to behave the way they used to (but not implemented the way they
used to be implemented).  That fixes *-line-or-search as a side-effect.
It might be possible to fix *-line-or-search independently, but IMO that
is glossing over the underlying brokenness of history-search-*ward.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~1998-06-09 18:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <aheading@jpmorgan.com>
1998-02-09 13:23 ` Zle bug Wez Furlong
1998-04-28 12:34   ` up-line-or-search still 'fixed'! Anthony Heading
1998-04-28 13:21     ` Andy Wick
1998-04-28 13:33     ` Anthony Heading
1998-04-28 14:08       ` Andrew Main
1998-06-09 13:13         ` Anthony Heading
1998-06-09 15:22           ` Bart Schaefer
1998-06-09 15:50             ` Bruce Stephens
1998-06-09 18:42               ` Bart Schaefer [this message]
1998-06-10 10:14                 ` Bruce Stephens
1998-06-10 10:31                   ` Zefram
1998-06-10 11:57                     ` Bruce Stephens
1998-06-10 17:13                       ` Bart Schaefer
1998-06-10  5:18             ` message numbers in mla Geoff Wing
1998-06-22 11:16               ` Geoff Wing
1998-06-22 16:17                 ` Bart Schaefer
1998-06-22 17:38                   ` Richard Coleman

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=980609114223.ZM6613@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=b.stephens@isode.com \
    --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).