From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7720 invoked by alias); 15 Dec 2014 07:09:44 -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: 19537 Received: (qmail 14678 invoked from network); 15 Dec 2014 07:09:42 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZoxtlUQGNdugwGKQuN2thfn6JR3nR5VJBTlOpN/7qBQ=; b=LOVcHxuIZ7IA3grhpLs9xM5Eiyn42QDeX3bkCCcMOArFFIV98irjY8fauw1p4oHI1U +jdUnPh/3Hrv5xkT1wTxfvZztLOvqGUvEAg5cMH8ydsRj5B34zyNhTl8UtYS+/4jzqAW B3+BDj8ET9Ev14oGP58db9pIDCsxDZV75qpv/wjR+FhhcxNvNp3xQ/QUd/q+Mb0Zav6j y8B4LUkqe4Hl8jCeTCnLPE0647wSyVXCPT8/BS1GsEusu+jpM7zFxHHsGKMFP+J/MOEV 9W4CKZZCQZS9LqXGwD8/VS5ebLb8GK0WP1ucZvBFx7QUNtKeH/Z+zHTIcUkv4Ow0bWac xujg== MIME-Version: 1.0 X-Received: by 10.180.98.162 with SMTP id ej2mr6706580wib.39.1418627379642; Sun, 14 Dec 2014 23:09:39 -0800 (PST) In-Reply-To: <141214185332.ZM24112@torch.brasslantern.com> References: <141214185332.ZM24112@torch.brasslantern.com> Date: Mon, 15 Dec 2014 02:09:39 -0500 Message-ID: Subject: Re: An example of writing a custom history file? From: Rocky Bernstein To: Bart Schaefer Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary=f46d044282740846ef050a3bedf4 --f46d044282740846ef050a3bedf4 Content-Type: text/plain; charset=UTF-8 Thanks for the pointer. That program is too complicated and there is too much going on for me to understand which parts add to the history file. I'm guessing it has something to do with the zle .push-line. Here is the 138 line program boiled down to less than 10, the parts I'd like to focus on: #!/usr/bin/zsh fc -ap /tmp/example_history 1000 # Read lines and add them to history local sticky while vared -h -p "hey: " sticky do print $sticky sticky='' done In the above, if I add lines to history file /tmp/example_history, I see them available in vared. However in the the above doesn't *add* lines to the history. Additionally what I would like to do in the body of the loop decide whether or not to add this to the history. Thanks On Sun, Dec 14, 2014 at 9:53 PM, Bart Schaefer wrote: > On Dec 14, 8:38pm, Rocky Bernstein wrote: > } > } Is there an example somewhere that I can follow for this? > > The only one I can suggest is Functions/Misc/sticky-note which comes > with zsh. Look at uses of "fc -ap". > --f46d044282740846ef050a3bedf4--