From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6066 invoked by alias); 5 Aug 2013 10:13:09 -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: 17907 Received: (qmail 2649 invoked from network); 5 Aug 2013 10:13:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.212.170 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=5lMeBAeTvk8M9pGAlNwbqxxQCI0izQDh0JHxmLTPqeg=; b=BKhrRDkI2yyL8f6blCj2Zn29NJdNGs0MUehW/v37aRIbwaaMfCsmDamfxgmbERgnGy X20mXpMZ26F2lzWyVDvqVe7Z+/a9XYXoVIyYlFdIro4Tgz12N37TLwqi9fvFGkyY13eG PoRwxdF60ocNyaG8dfOVqbD2FgOfzuaQlgyE1SuV68J061sXA9RT+9gzSCk1Z6XPIadk Mya4+p9ufQH8D31QLckYy9wAXmEV0dZx+Dsp/nKE2SBul3bg0BMUODzZUxpg1nFFdSTR QGmhO1OfpO0PRVgtKNMReFAEzbGocamUH7z4J92SVD2V1yZrmYuHE+60iFYLiFDRh/1m GdUA== X-Received: by 10.180.94.69 with SMTP id da5mr6253792wib.3.1375697159597; Mon, 05 Aug 2013 03:05:59 -0700 (PDT) Sender: Maarten Grachten Message-ID: <51FF7904.3030003@ofai.at> Date: Mon, 05 Aug 2013 12:05:56 +0200 From: Maarten Grachten User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: zsh-users@zsh.org Subject: Re: search through alternative HISTFILE Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Dear Peter, Thank you very much for your answer. Your use case is indeed similar, if slightly more complex. I had hoped I could reuse the existing history-incremental-search-backward widget, only changing the history before calling it. The relevant command (which you also use in your widget) seems to be "fc -p ". As I understand it, this pushes the current history and replaces it with a new history, read from . This approach actually works when I use the fc -p command on the command line before hitting Ctrl-R, but when I wrap it in a widget it does not work: # Define shell function to be used as widget: function accumulated-history-incremental-search-backward () { fc -p "${HOME}/.accumulated-history" zle .history-incremental-search-backward } # Tell zsh to use the function as a widget: zle -N accumulated-history-incremental-search-backward # Bind Ctrl-i to the widget: bindkey "^I" accumulated-history-incremental-search-backward Is there any particular reason why calling fc -p inside the widget does not affect the history search? Maarten