Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
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
         :cc:content-type;
        bh=l8FyN8fopoGLkRBGXUwTdf5dd2UZDD2XV3iPyjXLG+A=;
        b=FX6ShBXoV7gtNYPLJDn7NP0Ki7arwnVcK7h2ucnqAYCRQe2lXcLeGyiqhzTK+flNOH
         4rXlhliTUoI2TVSFzUJNdvTJNN/8UoOG+Rk3WizRZH2EsoIr3pNmW606JXAv6SWMqw64
         E4aJuELPDYZinrS0uEpU3HLuwiLfoyavgXrYNs79j5eR3LBNvnw1NIplzFh1fh2UUUWw
         Ei+Tu/a5gmHYkGkkjpE6oknxHstnwnZ6H6wymgo+Yze97B3+ntqum8pFYPZ0l1Yz1oAM
         amBIT9uNXptMA7YlAgZeqC1ulPrHfeLbUlHLr+4Ggo3GiKQ6BR5o+NcbG0yvxYDE/LiM
         Ue/g==
X-Received: by 10.112.64.5 with SMTP id k5mr24777908lbs.133.1452362395678;
 Sat, 09 Jan 2016 09:59:55 -0800 (PST)
MIME-Version: 1.0
In-Reply-To: <160109092258.ZM3394@torch.brasslantern.com>
References: <CAKc7PVCVFN2639GkbitXO_yZtqK02zUWH-oLGYBysv6J3TreTg@mail.gmail.com>
 <160109092258.ZM3394@torch.brasslantern.com>
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Date: Sat, 9 Jan 2016 18:59:36 +0100
Message-ID: <CAKc7PVAeF-krNekXWV-cbOzpZzRgTWt6iORA+BOmqVRWS1B2ag@mail.gmail.com>
Subject: Re: New widget "transpose-segments"
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 37525

On 9 January 2016 at 18:22, Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Jan 9, 12:03pm, Sebastian Gniazdowski wrote:
> } Subject: New widget "transpose-segments"
> }
> } I've attached a new widget "transpose-segments". Works like
> } "transpose-words", but the "words" are what I call "segments"
>
> How does this differ from
>
>     autoload select-word-style
>     select-word-style shell
>     zle -N transpose-words transpose-words-match
>
> ??

I now tested:

autoload select-word-style
select-word-style shell
autoload transpose-words-match
zle -N transpose-words-match
bindkey "^[t" transpose-words-match

The main difference is working across newlines. Also, the requirement
to position cursor at beginning of word to transpose is absent. I
think those two are important. Also, setting word style is not needed.
I have to admit that my functionality isn't new and practically exists
in Zsh already, however, why not have alternative approach available,
with freedom of where to position cursor and with support for
newlines. And with freedom for word style.

BTW. I asked about transpose-words on IRC and here, and then nobody
told me about set-word-style shell. That's maybe not bad if the
alternative (z)-based approach will be recognized as valuable.

Best regards,
Sebastian Gniazdowski

