From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11980 invoked by alias); 2 Jun 2011 03:07:15 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29433 Received: (qmail 21935 invoked from network); 2 Jun 2011 03:07:13 -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 realraum.at does not designate permitted sender hosts) X-SourceIP: 80.109.208.103 Message-ID: <4DE6FDA4.6060705@realraum.at> Date: Thu, 02 Jun 2011 05:04:04 +0200 From: Bernhard Tittelbach User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.23) Gecko/20091001 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: zsh-workers@zsh.org Subject: Re: Behaviour of {beginning,end}-of-buffer-or-history References: <110601192206.ZM14271@torch.brasslantern.com> In-Reply-To: <110601192206.ZM14271@torch.brasslantern.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.1 cv=JvXQbuMnWGQeb488dJ7w43Du7THgE+O7ieb9U20/rjk= c=1 sm=0 a=O8dyF41ITTcA:10 a=etco58mZcfEA:10 a=8nJEP1OIZ-IA:10 a=EJYIY0A_DfEaqXSC-CwA:9 a=wPNLvfGTeEIA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 On 2011-06-02 04:22, Bart Schaefer wrote: > On Jun 1, 9:57pm, Bernhard Tittelbach wrote: [...] Thanks ! :) > > } Jumping to the beginning/end of a line in a multi-line buffer > } is just an extra my function does, and not somewhere I think > } {beginning,end}-of-buffer-or-history > } should do (it's name does not imply any such functionality :) > > If you care to travel back in time 20 years or so you can take that > up with Paul Falstad. :-) If I learn how to do that, I'm sure that will be the first thing I'll use it for ;-) > > Meanwhile ... I think there's an easier way than whatever that is > you're doing with buflines and cur_array ... > > beginning-or-end-of-somewhere() { > local hno=$HISTNO > zle .${WIDGET:s/somewhere/line-hist/} "$@" > if (( HISTNO != hno )); then > zle .${WIDGET:s/somewhere/buffer-or-history/} "$@" > fi > } > zle -N beginning-of-somewhere beginning-or-end-of-somewhere > zle -N end-of-somewhere beginning-or-end-of-somewhere > Mhh, just when I got used to jumping to the beginning/end of a multi-line buffer with a double keypress of HOME/END ... But it certainly is shorter, faster and more readable ;-) and on single-line buffers completely equivalent to what my code did which is obviously going to be the predominant use-case. Thanks again, Bernhard