From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5003 invoked by alias); 14 Jan 2016 10:55:33 -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: 37620 Received: (qmail 23807 invoked from network); 14 Jan 2016 10:55:31 -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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID 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:from:date:message-id:subject:to :content-type; bh=vrCeV5tzv1Cd43VXHSRZKs0H+0d5P6Jv5ZWr4OWgxe0=; b=DgEvbHeaBAXpRX4E5OEQjrjooTZLihtbpr11C1zZiTHjOXoMHbylcnJEwLY/Fm8x3s lZhtNdBGBoG4Qiu/memozd5/MgUO5727jqiF/V50kbChTHwuDAH/tOpMZw4QspQJxUfI jdnKkbJ2CNqPWpl6zFqATWigAo0TdUtRzkNLdS5NVismdmO/+WmNcsitD34+JWVha4DD CxLWmasXu15ebGTuYgdNgkas8ASi3BZ2HeA14inHlP2U7iki+m0p1trfqG9Lr1JIw+vW OhZGES3c7XzOIdgMKPl0lhhKecm1IPY2wTQVTaFn/Pp12xgWwWEuNqhaOaK2hX6PzPAI VP3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=vrCeV5tzv1Cd43VXHSRZKs0H+0d5P6Jv5ZWr4OWgxe0=; b=ApGK6rgZWXGshinzCoGfsUQpwoWzFOD6wElb0U7XonqSYWw9xKAOpolokIqf+aQTeP elJylalaY0HyC0XiCd0SDixR4czq6dhRIJLYB9eoFOWbrTYQUHLfxEOD2c24S3/7TnoJ tzXZbj6eCePFGWWpDY9DxliZkWvCFrhKJubL3VZuUA7KbGtFJxSXwM/TIUUOPWepXoio vJwwD4gFrQSYIfTs8GL/HTZiom4MDX+h19lKevh5BKAjMPCzgLJu2tiFAUy932H1qYwC iOzPVALwRrSUVOBuaNiwop/6Ntkd6qxqfVh6ZKVJtMKcfBhbbQrmbpSAI+sBi24OYnJP laDQ== X-Gm-Message-State: ALoCoQkpi7xohhyJ+bUMXpt6YkfPepHdSzL2Kj6vTXmqdSv35rwCwKStlMchRMjpaeqi8Ogtru9HIemQlNa+Qb7cD2WjvmNCrw== X-Received: by 10.112.198.102 with SMTP id jb6mr907411lbc.44.1452768925856; Thu, 14 Jan 2016 02:55:25 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <160111161501.ZM5305@torch.brasslantern.com> <160112113928.ZM9065@torch.brasslantern.com> <20160113010147.GA4699@tarsus.local2> <160112180141.ZM9984@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Thu, 14 Jan 2016 11:55:06 +0100 Message-ID: Subject: Re: _history-complete-older problems with $( To: Zsh hackers list Content-Type: text/plain; charset=UTF-8 I have one idea. It's generally about detecting a syntax error that makes shell word unbound. By appending " x" to shell word and running (Z+n+) one can obtain either 1 or 2 elements and first signals a syntax error. For such case, SUFFIX would consist only from a space delimited part of the regular right part. Best regards, Sebastian Gniazdowski On 14 January 2016 at 11:14, Sebastian Gniazdowski wrote: > On 14 January 2016 at 10:52, Sebastian Gniazdowski > wrote: >> PS. I used the "find LBUFFER myself" approach to handle following case >> better ("|" is cursor): >> >> % $(( 0 |+ 1 )) >> >> Doing ${(z)LBUFFER} and then (z) on right part of BUFFER would produce >> SUFFIX="+" instead of "+ 1 ))". If I find the word in ${(z)BUFFER} > > That turned out to be not true, (z) isn't done on right part, instead > words[CURRENT] is utilized and chopped to obtain right part of shell > word. > > local -a left=( "${(z)LBUFFER}" ) > local right="${words[CURRENT]#${left[-1]}}" > > So still clarifying things, maybe it's good idea to do (z) on right > part to obtain ${|a case behavior. > > Best regards, > Sebastian Gniazdowski