From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11236 invoked by alias); 28 Dec 2016 01:27:59 -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: 22297 Received: (qmail 12224 invoked from network); 28 Dec 2016 01:27:59 -0000 X-Qmail-Scanner-Diagnostics: from mta03.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.9):SA:0(-3.8/5.0):. Processed in 1.47852 secs); 28 Dec 2016 01:27:59 -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, 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.9 as permitted sender) X-Authority-Analysis: v=2.2 cv=ZvqvEJzG c=1 sm=1 tr=0 a=28Ntk8jg+Dho8ABWn/CRtA==:117 a=28Ntk8jg+Dho8ABWn/CRtA==:17 a=N659UExz7-8A:10 a=P5_RkqyVqkr2D-3FbEUA: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> From: Ray Andrews Message-id: Date: Tue, 27 Dec 2016 16:57:48 -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: <161227155552.ZM2385@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 27/12/16 03:55 PM, Bart Schaefer wrote: > That's what $'...' does, but you can't ask for a C string and for > variable interpolation at the same time. Well, you can, but it > doesn't really help. ;-) Indeed. Be careful what you ask for ... I am expecting the variables to expand. It's all this backslash and 'is it one string or several strings' stuff. Dunno ... is that really different? It just seems that the expansion of the variables is 'visible' for lack of a better word -- you expect it, it's not a gotcha the way the rest is. For me, the task is to see the 'naturalness' for lack of a better word of the way that zsh does this: print -rS -- "rap ${${(q+)@}}; : ${(q-)HOST}" ... it seems that the backslashes need protecting and reprotecting and yet more protecting and each stage of the protection is different from the last. Couldn't we just: setopt protect-backslashes-thanks print -S "rap $@; : $HOST" ... it's not that the backslashes are presumed special, it's that I'd say we should only have to press one button once to literalise them. Is it impossible that this could be simple and intuitive? No ordinary mortal would know to do what you guys showed me, one must be shown and even Bart and Daniel didn't get it exactly right the first time. What hope do I have? > > Maybe this would be easier (in the "should have thought of this before" > category): > > print -s -f '%s' rap "$@" ";" ":" "$HOST" > > (Note this doesn't work with -S, which currently is silently ignored if > the -f option is given, but as you already have all the words separated > here there's no reason to re-parse them.) > I'll chew on that.