From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25167 invoked by alias); 21 Jun 2015 07:09:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35549 Received: (qmail 21405 invoked from network); 21 Jun 2015 07:09:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 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=lxCcPN1ZJVAKe6m6ZiwPVTttmoYrDG+Rw0dQEe/h+UM=; b=div6RBnSRxYPDXtMSlzH6mBITxo/iJmG6xOS/dxiZUAaoWCbm3t36TwR1grcdDfTMu EjPuZAS1a0Fh+H5VUlMai4F86lmQvoyc6tOtt91LBpOPh7330n4aLp/MXXjBV6Vc0nMK DRyDwO9C8OoKuaJ/vhJ7xxVtdfJtXabuAg3EY6FkYY4/jlqPZ1XSdhnT6Xyt1tsREpIx TuFoGUaRDmX36hf35OvpOEj2ueI2VVIMFlIIjoxgnnepIIcalMMA0pAYcyML5v44ogw1 9A4xwK6ANx9biKwg84y9/QNL3e0i8fO+lFWj8ogpf3a0hM/zgRDsYuCtjQmGSiE/ieVF GnDw== MIME-Version: 1.0 X-Received: by 10.107.130.101 with SMTP id e98mr30445329iod.38.1434870569769; Sun, 21 Jun 2015 00:09:29 -0700 (PDT) In-Reply-To: <20150620180659.735a6cc6@ntlworld.com> References: <20150620180659.735a6cc6@ntlworld.com> Date: Sun, 21 Jun 2015 09:09:29 +0200 Message-ID: Subject: Re: This widget implementation feels a bit clunky (edit-quoted-word) From: Mikael Magnusson To: Peter Stephenson , Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Sat, Jun 20, 2015 at 7:06 PM, Peter Stephenson wrote: > On Sat, 20 Jun 2015 11:16:20 +0200 > Mikael Magnusson wrote: >> I feel like it's unnecessarily hard to get the resulting text from a >> narrow-to-region session. > > Would you want something like this? That does look very promising, yeah. :) I suppose I should volunteer for writing the doc patch for this. On Sat, Jun 20, 2015 at 7:21 PM, Bart Schaefer wrote: > On Jun 20, 11:16am, Mikael Magnusson wrote: > } > } I feel like it's unnecessarily hard to get the resulting text from a > } narrow-to-region session. > > Hmm. If you used "narrow-to-region -S state ..." then I think the > resulting text would be $BUFFER between the exit from recursive-edit > and the call to "narrow-to-region -R state" ? > > Except that I'm having a little trouble with -S / -R. The value of > $MARK never seems to be correctly restored. Is it supposed to be? I'll admit I didn't actually look at the impl of the widget, only the documentation. > } It would be nice if quote-region let you specify the type of quoting. > } Urk? > > The difficulty there is that it's a widget so there's no direct way to > pass the type of quote. I suppose you could use $NUMERIC. I thought widgets can take an arbitrary amount of arguments, although it is true that almost none do. The newly added bracketed-paste takes an argument that names the parameter to store pasted text in for example. If you mean that you can't do it directly via bindkey then yeah, that's true, you'd still need a wrapper widget. For my use-case I could put the argument right in with the zle call though. (But with PWS' suggested change, I can just insert (q-)LBUFFER/RBUFFER directly, I think). -- Mikael Magnusson