From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1267 invoked from network); 13 Oct 2008 03:31:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Oct 2008 03:31:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 95701 invoked from network); 13 Oct 2008 03:30:47 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Oct 2008 03:30:47 -0000 Received: (qmail 25811 invoked by alias); 13 Oct 2008 03:30:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25869 Received: (qmail 25785 invoked from network); 13 Oct 2008 03:30:30 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 13 Oct 2008 03:30:30 -0000 Received: from vms046pub.verizon.net (vms046pub.verizon.net [206.46.252.46]) by bifrost.dotsrc.org (Postfix) with ESMTP id 737C480524C0 for ; Mon, 13 Oct 2008 05:30:27 +0200 (CEST) Received: from torch.brasslantern.com ([96.238.220.215]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K8N00FLJR2DVFE1@vms046.mailsrvcs.net> for zsh-workers@sunsite.dk; Sun, 12 Oct 2008 22:30:14 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m9D3UDZd027770 for ; Sun, 12 Oct 2008 20:30:13 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m9D3UCan027769 for zsh-workers@sunsite.dk; Sun, 12 Oct 2008 20:30:12 -0700 Date: Sun, 12 Oct 2008 20:30:12 -0700 From: Bart Schaefer Subject: Re: Current history number in command line In-reply-to: To: zsh-workers@sunsite.dk Message-id: <081012203012.ZM27768@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: Comments: In reply to ( Text in unknown character set UTF-8 not shown ) Sommer "Current history number in command line" (Oct 12, 9:25pm) X-Virus-Scanned: ClamAV 0.92.1/8415/Mon Oct 13 03:06:19 2008 on bifrost X-Virus-Status: Clean On Oct 12, 9:25pm, Joerg wrote: } } while searching the history with ^R, is it possible to get the number of } the current history entry? Not easily. With an ordinary motion widget, you can write a wrapper that grabs the value of HISTNO and puts it somewhere useful. Simple example: up-line-or-history() { zle .up-line-or-history "$@" RPS1=$HISTNO zle reset-prompt zle -R } zle -N up-line-or-history With history-incremental-search-*, you don't have this luxury, because the input and display for the incremental pattern is handled entirely inside the widget; there is no hook for resetting the prompt. If you're feeling ambitious, Functions/Zle/history-pattern-search is a good starting point; it's already manipulating HISTNO so it shouldn't be hard to find a place to add a few lines to poke something into the prompt.