From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9585 invoked by alias); 30 Aug 2010 17:34:59 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15343 Received: (qmail 25121 invoked from network); 30 Aug 2010 17:34:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <100830103433.ZM3713@torch.brasslantern.com> Date: Mon, 30 Aug 2010 10:34:33 -0700 In-reply-to: Comments: In reply to Felipe Contreras "Please fix history-search-backward/forward" (Aug 28, 9:54pm) References: In-reply-to: Comments: In reply to Mikael Magnusson "Re: Please fix history-search-backward/forward" (Aug 29, 12:33am) In-reply-to: Comments: In reply to Felipe Contreras "Re: Please fix history-search-backward/forward" (Aug 29, 3:52am) X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Please fix history-search-backward/forward MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Aug 28, 9:54pm, Felipe Contreras wrote: } } zle says: } Search backward in the history for a line beginning with the first } word in the buffer. } } GNU readline says: } Search backward through the history for the string of characters } between the start of the current line and the point. } } I don't see why anybody would want zle's behavior. IIRC (it's been a very long time) the expected usage was to recall the previous history line with ctrl+p and then look backward for some other history entry where the same command was run with different arguments. (That's how I use it, in any case.) However, please keep in mind that zsh was written from scratch about 20 years ago by a university student who really just wanted something saner than csh with an emacs-like line editor. If ZLE doesn't pre-date readline, they're at least near-contemporaries, and zsh's command set bears no direct relation to readline's -- in fact many zsh features were based on (sometimes mis-)reading of emacs and ksh documentation by someone who didn't have ksh and may (I forget) only have had the Gosling version of emacs rather than Stallman's. Note that for the first many years of its existence nobody who had ever used bash was moving to zsh -- new zsh users were all coming from csh or the old Bourne sh and had never had line editing at all, much less have any expectation of naming congruence with readline. Furthermore, it has always been a major tenet of zsh development that nothing gets changed merely because a new developer has come along and disagrees with previous design decisions. Unlike many current OSS projects which seem to discard the past twice a week and make all the users adapt to something new, with zsh we've always tried very hard to provide that someone who last used zsh a decade ago can sit down with the latest and start running his old scripts from muscle memory and barely notice the difference (unless he wants to). } When I type "git check"; I expect the whole text to be searched; You have history-search-* bound to TAB? What do you use for completion? On Aug 29, 12:33am, Mikael Magnusson wrote: } } On 29 August 2010 00:23, Felipe Contreras wrote: } > The point is that history-beginning-search-backward-end encompasses } > the functionality of history-search-backward, so why not make } > history-search-backward do the same as } > history-beginning-search-backward-end, if no functionality would be } > lost? } } They behave differently so I'm not sure what you mean. Trying to } emulate history-search-backward behavior in } history-beginning-search-backward(-end) would involve lots of awkward } cursor movement to put it after the first word. (See my example above about ctrl+p followed by esc-p.) } OTOH, if you want the default bindings for ^[p and ^[n to be changed, } I have no counter argument, but who even uses those keys for history } movement? Er, I do, actually. All the time. I also have bindkey ^Xp history-beginning-search-backward and use that probably slightly more often, but not a lot more often. On Aug 29, 3:52am, Felipe Contreras wrote: } } Ah! } } So both start from the beginning, so what's the 'beginning' in the } former supposed to differentiate? Wouldn't history-cur-search-backward } make more sense? The history-search-backward widget was around for a few years before history-beginning-search-backward was added. A new name was needed for the new behavior (so as not to break anyone's old zshrc) and one was chosen that made sense at the time.