From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8881 invoked by alias); 16 Sep 2016 17:09:27 -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: 21930 Received: (qmail 1837 invoked from network); 16 Sep 2016 17:09:26 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f172.google.com 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(209.85.192.172):SA:0(0.0/5.0):. Processed in 0.764508 secs); 16 Sep 2016 17:09:26 -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=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=qtvh8ZsHK9gt28Bn4ValQuGEaTMmBx+SbEip3KRhn/E=; b=nDVnpxx1eAphZdX93cuBUDcvzCco+BWxUSRd6Hqvc7fJCI8mXs+6VFzLr0DvP43iCO jFb7qQgdaNHp30X6LZMEpRZq9GjrAfDpReAUkpr7mcPOfgPMZ1MEpBGk6yI9Xh3avmqA yKR1JtW34BMcgonstlMbMP2TWun9CwLaEN345UHYRZICwhDAnKKrGeMpEdggPz34oTl7 HlPb1PdqpPmjXHLYHUN2tS12gpW+a9za9MYeCVmV7V4RvTC296oQVapF4/4zihY5IsL3 wi1mrNr4xIe50ZL/RVMbMAzUjxWrgXH7uA8LsvXtJeNWBI9JedU5olah+XwdudGT3m61 +sDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=qtvh8ZsHK9gt28Bn4ValQuGEaTMmBx+SbEip3KRhn/E=; b=UauliJQQAGijamH7BPUvA6BGhIMcSeOW7AibvAxeRdHLi/xNtRgv6KLhXtJBUEu6zl S7qlngE3IsYRzk8RtX2lZbYnJGmuPSmEFTSf1ueQSgg8t+QPKFfy8YihHgwkxmyjv1fL IAwB6nWDKh37DhwxO9jUhKxNn/KQ96RowVw77jQY6wbXIbyO/swTPbbT8j1CLfgDOgmb ZIRnui3XPS+2/7BkIuL8Wp2oR6ZOd4dyOYSD+M/XSEtXz5b+RFUlyaLxdOs92k+sW0wq 6Izk/pj77lnO5OMcWyr/Um+oa8xTCO2s7KeJaZX78rAgp2wM97cP8jDFqqpp33tRaipi 8O/g== X-Gm-Message-State: AE9vXwP8IJnIsIlCm3KNu37KM1o2xLbiJFknM9D32UbL9PHFPro8uBRaRco78/mF/4A0WA== X-Received: by 10.98.98.193 with SMTP id w184mr24636131pfb.120.1474045758423; Fri, 16 Sep 2016 10:09:18 -0700 (PDT) From: Bart Schaefer Message-Id: <160916100934.ZM11263@torch.brasslantern.com> Date: Fri, 16 Sep 2016 10:09:34 -0700 In-Reply-To: <20160916105230.GB3491@cventin.lip.ens-lyon.fr> Comments: In reply to Vincent Lefevre "Re: Quoting the arguments to a function" (Sep 16, 12:52pm) References: <20160916105230.GB3491@cventin.lip.ens-lyon.fr> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Quoting the arguments to a function MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 16, 12:52pm, Vincent Lefevre wrote: } Subject: Re: Quoting the arguments to a function } } On 2016-09-15 14:41:03 -0700, zv wrote: } > Is there any way to signal to ZSH that an alias or fn should have } > arguments supplied literally? } } IMHO, arguments should also be properly quoted, but the solution } would be a feature in ZLE to do the quoting automatically. Something } like url-quote-magic. The nice thing about url-quote-magic is that it can make all of its decisions based solely on examinination of the current word; if the beginning of the word looks like "schema:" (for various values of schema), then the rest of the word is subject to quoting. To do argument quoting based on the command context, one must either accept the naive solution of examining only the first word on the line, or do more detailed command-line analysis on the level of what's done by the completion system. This could probably be done with a special completer supplied by a zstyle to the incremental-complete-word function. One difficulty with that is that incremental-complete-word is itself crufty and built using years-old functionality; there's probably a much better way to accomplish the equivalent in modern zsh. It's also pretty easy to create a little widget to quote the current word: quote-this-word() { zle select-in-blank-word; zle quote-region } zle -N quote-this-word bindkey \'\' quote-this-word (That is, if I type single-quote twice in fairly rapid succession, quote the word the cursor is in or follows. Users of RC_QUOTES may want to use two double-quotes or some other combination.)