From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10280 invoked by alias); 6 Nov 2013 20:07:26 -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: 18106 Received: (qmail 4489 invoked from network); 6 Nov 2013 20:07:20 -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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=B6dqthFdPRQ0MpgefoqZjg3OHbwN1MnPMXWADRM3ZH4=; b=XG/8dwOdpLcXlPI2RjxIN6VMbUyuk2q8W0pT9ehwekz0fYaxzBim3e9c0ILCR6l0Uf fozLWrEbpEiQa1Q7UN71KDi7IRVAnULyOwYPSDP3euJbM8HIUzVLJ6JoZEUgQZ+lDCgC QrSUMmcsijX1HLpo9kFeMf/ut+92wfADLmnW9IKpH/EejjBHFbVtUOok7+QjcXWBd0Fe tdYuumYQa8aHVO7reXBwGAEfFBthFpgjbPfqCsYbGx81YU7DMCtZUKBKtvDSZwFHOBV4 21H/yW12RLHldXY1qmbj5G9QNO06ioPyERC+WOoIkaG02EIv6DT/xiRMIaC82GIoxKL8 e8Qw== X-Gm-Message-State: ALoCoQkRYxvPiBEYL/Hq2nQAM5U06/p0MIS5F6q9bJ2T5kfsInIX4veKMwd2gzj7Es5vG+Bs9XD1 X-Received: by 10.180.80.163 with SMTP id s3mr22663057wix.51.1383768437958; Wed, 06 Nov 2013 12:07:17 -0800 (PST) X-ProxyUser-IP: 86.6.157.246 Date: Wed, 6 Nov 2013 20:07:15 +0000 From: Peter Stephenson To: Zsh-Users List Subject: Re: Fish-like autosuggestions Message-ID: <20131106200715.6e549a6e@pws-pc.ntlworld.com> In-Reply-To: <131105124000.ZM18277@torch.brasslantern.com> References: <131030092555.ZM8077@torch.brasslantern.com> <131105075700.ZM18043@torch.brasslantern.com> <20131105161858.543037da@pwslap01u.europe.root.pri> <131105114640.ZM18224@torch.brasslantern.com> <131105124000.ZM18277@torch.brasslantern.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 05 Nov 2013 12:40:00 -0800 Bart Schaefer wrote: > On Nov 5, 11:46am, Bart Schaefer wrote: > } > } ... a single predefined widget name that is called at that point ... > } > } Hmm, the doc doesn't actually explain what the return value from a -F > } handler means to the surrounding code. There should probably be some > } sort of return-code-based protocol to indicate whether handling should > } proceed, which makes me lean away from the "instead" option but still > } doesn't resolve before/after for me. It doesn't mean anything: it doesn't make sense for a function listening for one file descriptor to cause aborting of a function or widget associated with a different descriptor. I'd suggest simply we have either a widget or a normal function for each descriptor and the problem goes away. It doesn't make sense to process input from the file descriptor twice so assigning two processor entities should just be an error. > A bit more examination leads me to feel that running the zle -F handler > first, and then skipping the widget ("zle-tcp-handler" ?) if the -F > function returns nonzero, is probably the most sensible way to go, both > for backward compatibility and because it's harder to interpret the > "failure" of a widget. You'll have to associate a widget with a file descriptor, so it'll need to have a specific name --- we could use magic names like zle-tcp-handler-, but that's a bit messy and doesn't make clear the competition between reading the fd this way and the original way. We can't just use a generic widget because we don't know what file descriptors we're listening on. Listing file descriptors separately from defining a widget loses both functionality and coherence --- if you have multiple file descriptors there's no reason to suppose you want to call the same widget for each, indeed there very likely to be doing completely different tasks. So I think the easiest thing is just slightly augment the interface with an option to say the argument names a widget rather than a function. This also makes the implementation easy: we just do something a little bit different based on a flag associated with each string in the list. pws