From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5277 invoked by alias); 19 Sep 2016 10:08:53 -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: 39386 Received: (qmail 2139 invoked from network); 19 Sep 2016 10:08:53 -0000 X-Qmail-Scanner-Diagnostics: from nm16-vm5.bullet.mail.ir2.yahoo.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(212.82.96.211):SA:0(0.0/5.0):. Processed in 0.43878 secs); 19 Sep 2016 10:08:53 -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=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.mail.yahoo.com designates 212.82.96.211 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1474279315; bh=hWpZmjcx+UkvTnGstmrMhxihu0zt8VBfkI7q2DlOZIE=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=auo7WCEZGEWtamBecgwSioA3LpQyQEiCdm1d4oP1GJdofrNfj5MH4/MKkjlXVogqzsxZ4x4oFGVUrl6wvC7JW2Io+CAO34RZ+rpoFO16IHq4gU+KpB/TSQ3MdSKfkfqYr8oWkuGoV33pEsHgQ6US0+GRxOMoRjZfbdHZC9qEqmX6akwdktmB8qu5q6p6hVy1fYc5v8MW4TU1QScvfgmogj6IL8ZVnahAo1hUCAculTv8JzCHmdsNtrnza9BRMmWyI3YuMJyx1DKflaTfGZPKcntnE51yotzyEA8HJchaFd9It5x0UsGp/dmCHYKBH7oihbaCUJtjue4DLVUfHthYgw== X-Yahoo-Newman-Id: 339220.80087.bm@smtp144.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: _m4TK7wVM1mlkwhq33VVq7a3Zk0R08UCiw3oeQwSagEquUN Uk4QGdIaPf.BJRqqDy0wsgtQjPBKj6kf.gHwtjWoKBYF9QZi8YQS7YZlzFuZ snm_69a959ij0WQhjB7DNNdrylEEInHPqKvaMx_17VTVebUpnkiXU1HEgghB 0WTKe1Wp75ygM19BuoYBsksRB8qe_4h_iNBNLHhithyfDaVTCBX_exuOeTyD BX1nyIEPqDprHgLQgaXGk1hCduq.hjAjO98B360wmGXJn6R4hzHw2L.gp7xc 41Kx6BSCIh0QH2o2LW0._kMS29xEJlOuDSNx6LysD0oMR9MXEY2H8gYexxyQ h3EiABeRW3thAFkL5vMG8OIP1yEtrHgK1fKo.Lme0qI7Rd56tkOMAmHAJ3c9 M5PyXVPFbmCFRAQ52y2JzyUwehXAJfFaP15sNwMLoe55BQwFpnmw_SLkpT6I JFw.Tb8ZC5M7N52DNUDYL5Nki8C20SwGTmnc_T918uA5vp4q4ig2X.tVyWes ZgN8bfWmKgkL.EDlnzbGIBy.v1IuWbEudZ7J1mVUxYf8- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <20160919070020.GA3836@fujitsu.shahaf.local2> From: Oliver Kiddle References: <160916102137.ZM11290@torch.brasslantern.com> <76020.1474058827@hydra.kiddle.eu> <160916142248.ZM26196@torch.brasslantern.com> <10734.1474068633@hydra.kiddle.eu> <160916200205.ZM27241@torch.brasslantern.com> <20160917074259.GA26221@fujitsu.shahaf.local2> <160917072918.ZM29255@torch.brasslantern.com> <20160919070020.GA3836@fujitsu.shahaf.local2> To: zsh-workers@zsh.org Subject: Re: Off-by-one with select-*-shell-word text object? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <47449.1474279314.1@hydra.kiddle.eu> Date: Mon, 19 Sep 2016 12:01:54 +0200 Message-ID: <47450.1474279314@hydra.kiddle.eu> Daniel Shahaf wrote: > Bart Schaefer wrote on Sat, Sep 17, 2016 at 07:29:18 -0700: > > On Sep 17, 7:42am, Daniel Shahaf wrote: > > } > > } I think it would be cleaner to invent a new bitmask flag and set it on > > } the affected widgets (select-*-word, run-help, etc) than to overload > > } WIDGET_INT for this purpose. > > > > It's not overloading WIDGET_INT, it's overloading ZLE_VIOPER - because Or arguably it is bindk that is overloaded from when $WIDGET was added as a shell interface. I'd consider redundancy in the flags to be worse than overloading. > As Oliver said, aside from the vi operator widgets, only 4 builtin > widgets care about whether $WIDGET points to themselves or not. There > is no reason, AIUI, to force set_bindk to 1 for the other 390 builtin > widgets, as well as for all future widgets implemented in modules. You've got to force set_bindk to either 1 or 0 and my guess is that a future widget is more likely to want 1 than to want 0. Even with a new bitmask flag, I'd sooner opt for it having the opposite sense to what you suggest. > That's why I suggested to invent a new bitmask flag that implies > set_bindk on a per-widget basis: the property 'requires $WIDGET to be > self-referential' does not follow from 'is implemented in C'. I can > also imagine future user-defined widgets that need $WIDGET to always > point to themselves. We've already got a wealth of ZLE_ flags and setting them for a new widget can be error prone. Nobody ever noticed that run-help, which-command and zap-to-char wouldn't work from a shell widget so picking up on errors is not necessarily easy. [aside: if anyone relied on it for run-help/which-command to invoke their own command, they should use zle -A]. getvirange() is more concerned with the keys that were used than with the identify of the widget. That's why I'd sooner regard it as bindk that is overloaded. But I don't think adding another variable like $WIDGET is a good idea. Would just complicate the interface and it isn't really needed. Oliver