From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16963 invoked by alias); 28 Dec 2016 21:24:34 -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: 22307 Received: (qmail 18289 invoked from network); 28 Dec 2016 21:24:34 -0000 X-Qmail-Scanner-Diagnostics: from mta02.eastlink.ca by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(24.224.136.13):SA:0(-3.8/5.0):. Processed in 0.654151 secs); 28 Dec 2016 21:24:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: rayandrews@eastlink.ca X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.eastlink.ca designates 24.224.136.13 as permitted sender) X-Authority-Analysis: v=2.2 cv=DOfN2GFb c=1 sm=1 tr=0 a=28Ntk8jg+Dho8ABWn/CRtA==:117 a=28Ntk8jg+Dho8ABWn/CRtA==:17 a=N659UExz7-8A:10 a=_SbFr3y932x8r7i5OJYA:9 a=pILNOxqGKmIA:10 X-EL-IP-NOAUTH: 24.207.16.108 Subject: Re: append to history entry? To: zsh-users@zsh.org References: <5288b537-f06a-d18a-60ea-1f962856c80c__41345.3811700039$1482803962$gmane$org@eastlink.ca> <20161227125530.GA4796@fujitsu.shahaf.local2> <161227080022.ZM519@torch.brasslantern.com> <99549001-5744-c36f-a4dc-404071aba08a@eastlink.ca> <161227110954.ZM1153@torch.brasslantern.com> <0a48db86-b41a-283c-8193-e2766aa5d30b@eastlink.ca> <161227155552.ZM2385@torch.brasslantern.com> <161227220458.ZM3240@torch.brasslantern.com> <161228102207.ZM5358@torch.brasslantern.com> <388b7c6d-8740-a487-1281-6f56b5cbc8e4@eastlink.ca> From: Ray Andrews Message-id: <3b8fe027-d7fb-25fb-bc05-9ecd3a91b08f@eastlink.ca> Date: Wed, 28 Dec 2016 13:24:25 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-version: 1.0 In-reply-to: <388b7c6d-8740-a487-1281-6f56b5cbc8e4@eastlink.ca> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 28/12/16 11:20 AM, Ray Andrews wrote: > Ok, I'll see what I can figure out. > > Needless to say this is exploratory: function zshaddhistory () { LITERAL=( "${(@s/;/)1}" ) #print -rl $LITERAL LITERAL[1]=${LITERAL[1]/ #/} LITERAL[2]=${LITERAL[2]/ #/} LITERAL[3]=${LITERAL[3]/ #/} LITERAL[4]=${LITERAL[4]/ #/} LITERAL[5]=${LITERAL[5]/ #/} #print -r $LITERAL[1] #print -r $LITERAL[2] #print -r $LITERAL[3] #print -r $LITERAL[4] #print -r $LITERAL[5] } function test () { print -r "you typed: $LITERAL[1]" } $ test \r * \n""'' you typed: test \r * \n""'' $ test $HOST you typed: test $HOST ... but it seems to do exactly what I want the only thing lacking is to associate each member of the array to the appropriate command, if there are several on the same line. I can think of a few hacks that might do it, but is there a robust way? Would precmd() be able to keep count? Something of that nature? This is going to come out right.