From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28681 invoked by alias); 10 Jan 2016 19:59:46 -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: 37552 Received: (qmail 12572 invoked from network); 10 Jan 2016 19:59:45 -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 autolearn=ham autolearn_force=no version=3.4.0 Date: Sun, 10 Jan 2016 19:59:43 +0000 From: Daniel Shahaf To: Sebastian Gniazdowski Cc: Zsh hackers list Subject: Re: backward-kill-shell-word widget Message-ID: <20160110195943.GB11464@tarsus.local2> References: <20160110003758.GA28696@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sebastian Gniazdowski wrote on Sun, Jan 10, 2016 at 14:37:26 +0100: > I see that you use (z) flag :) I think this is cool. I just was about > to decide to bind shell-worded transpose-words-match to Alt-r (have > transpose-segment bound to Alt-t) and noticed that I rather want to > keep select-word-style bash. I rather want Ctrl-W to delete normal > words. So with your function one can have: > - "Ctrl-W" / backward-kill-word to delete word with style of his choice > - transpose-words-match to swap words with style of his choice, > keeping in mind to position cursor at beginning of the words > - "Alt-m" / copy-prev-shell-word to copy shell word regardless of word style > - "Ctrl-T" / backward-kill-shell-word to delete shell word regardless > of word style > - "Alt-t" / my transpose-segment to swap shell words regardless of > word style (should I rename the widget to "transpose-shell-word", > looks like yes) > - "Alt-/" / _history-complete-older to complete shell words regardless > of word style > > I think this goes into a nice workbench for quick manipulation of > command line, if one devotes time to establish order in that set of > loosely coupled functionalities. Don't put too much weight on my choice of for b-k-s-word. It's not my preferred choice for b-k-s-word, it's simply the chord I always use for testing widgets. As to the general issue, I'd consider some more systematic approach. Vi has its operators; you could have something similar by having a "prefix key" that chooses the word style: e.g., or would "delete a shell word backwards", or would "delete a whitespace-separated word backwards", and plain would delete a default-styled word backwards. And of course a NUMERIC could be prepended to any of those, just as with vi operators. How does emacs handle this issue? Does emacs have different chords for different kinds of "delete a word backwards"?