From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3521 invoked by alias); 23 Jan 2012 22:21:33 -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: 16741 Received: (qmail 18337 invoked from network); 23 Jan 2012 22:21:31 -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=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 74.125.82.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Eed7zO5/3NMSOyqcOCzb9UYj4p2pMNBUh6sX4OA9fNQ=; b=CKEFxCBFx9bcZ7NwjyjalZabU0L5iXHV1pjnfXoFVsukptNyN6mnt8aAqPfo8yI7Sq U+4KAaHFZKVf8znTgapJA3Amh4z6nEmrw7HmF7SCToM77EbaIaKSelXKpOiLSb6KetSO L43HNXLrI4fbd/5fHKAKyl+dHxFvPHR9i6BUY= MIME-Version: 1.0 In-Reply-To: <20120123205150.27077e4eea9d7be1e632508f@users.sf.net> References: <20120123205150.27077e4eea9d7be1e632508f@users.sf.net> Date: Mon, 23 Jan 2012 23:13:52 +0100 Message-ID: Subject: Re: "Literal" command execution From: =?UTF-8?Q?Damien_Th=C3=A9bault?= To: "Yuri D'Elia" Cc: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Jan 23, 2012 at 20:51, Yuri D'Elia wrote: > I'm trying to reduce some typing here, as usual ;). > I have a command line logger that allows free text as its main arguments = (random example: taskwarrior). A typical example might be: > > =C2=A0command log [free text follows] > > I want to reduce escaping to the bare minimum. Dollars are not really a p= roblem, but I discovered myself to escape '<' '>' and '!' too often. > > Of course I am already aware of both noglob and nocorrect, but I would ne= ed something more extreme, as in "feed whatever text, including #, etc, tha= t follows the command as arguments". > > Is there any way to achieve that? > Maybe by some rewriting trick? Hello, For URLs I'm using something called url-quote-magic: when I start writing an URL, it's detected and then all special characters are escaped (&, <, >, !). autoload -U url-quote-magic ; zle -N self-insert url-quote-magic This is really great for copying+pasting URLs, for example to use it in wge= t. What you want to do looks pretty similar, so maybe this could be a starting point for you? (except it's during a specific command arguments instead of autodetected) Regards, --=20 Damien Thebault