zsh-workers
 help / color / mirror / code / Atom feed
* Suggestion: forward-delete-word
@ 2018-09-24 18:29 Noam Barnea
  2018-09-24 18:59 ` Jérémie Roquet
  0 siblings, 1 reply; 6+ messages in thread
From: Noam Barnea @ 2018-09-24 18:29 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 768 bytes --]

There are many widgets that go backwards and erase some amount of text:
backward-delete-char, backward-delete-word, backward-kill-line, and
backward-kill-word. But, there are no such widgets going forward. The
forward direction only has movement by char or word but no erasure.
That could be inconvenient as that's a whole direction of text that has no
efficient solution for getting rid of text.

Now, ideally I would find where such widgets are defined in the code and
add them in myself, but I do not have enough C or zsh knowledge to do that
and I'm heading to a convention tomorrow. I would not have access to a
computer for at least three days. That's why I'm suggesting it here (in
hopes it gets picked up).

Good luck and thank you for your time,
Noam Barnea.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Suggestion: forward-delete-word
  2018-09-24 18:29 Suggestion: forward-delete-word Noam Barnea
@ 2018-09-24 18:59 ` Jérémie Roquet
  2018-09-26  5:32   ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Jérémie Roquet @ 2018-09-24 18:59 UTC (permalink / raw)
  To: Noam Barnea; +Cc: Zsh Hackers' List

Hi Noam,

2018-09-24 20:29 GMT+02:00 Noam Barnea <thekittendev@gmail.com>:
> There are many widgets that go backwards and erase some amount of text:
> backward-delete-char, backward-delete-word, backward-kill-line, and
> backward-kill-word. But, there are no such widgets going forward. The
> forward direction only has movement by char or word but no erasure.
> That could be inconvenient as that's a whole direction of text that has no
> efficient solution for getting rid of text.

These gadgets actually do exist already, except they are called
delete-char, delete-word, kill-line, kill-word, etc.

I've been confused by the asymmetry in the names too. Historical
reasons, I guess… The names are the same in Emacs, by the way.

Best regards,

-- 
Jérémie

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Suggestion: forward-delete-word
  2018-09-24 18:59 ` Jérémie Roquet
@ 2018-09-26  5:32   ` Bart Schaefer
  2018-09-26 14:55     ` Daniel Shahaf
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2018-09-26  5:32 UTC (permalink / raw)
  To: zsh-workers; +Cc: thekittendev, jroquet

On Mon, Sep 24, 2018 at 12:00 PM Jérémie Roquet <jroquet@arkanosis.net> wrote:
>
> 2018-09-24 20:29 GMT+02:00 Noam Barnea <thekittendev@gmail.com>:
> > There are many widgets that go backwards and erase some amount of text:
> > backward-delete-char, backward-delete-word, backward-kill-line, and
> > backward-kill-word. But, there are no such widgets going forward.
>
> These gadgets actually do exist already, except they are called
> delete-char, delete-word, kill-line, kill-word, etc.
>
> I've been confused by the asymmetry in the names too. Historical
> reasons, I guess… The names are the same in Emacs, by the way.

They're named the way they are in zsh BECAUSE they were first named
that way in emacs.  ZLE's default mode is supposed to be an emacs
emulation (emacs from about 1992 plus a bunch of special cases for
shell tasks, to be more precise).

You can also get forward motions by typing ESC - (that's two
characters, escape and hypen (minus)) before typing the character for
a backward motion, i.e., ESC - ^H deletes forward one character, ESC -
^W deletes forward one word.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Suggestion: forward-delete-word
  2018-09-26  5:32   ` Bart Schaefer
@ 2018-09-26 14:55     ` Daniel Shahaf
  2018-09-26 15:05       ` Mikael Magnusson
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Shahaf @ 2018-09-26 14:55 UTC (permalink / raw)
  To: zsh-workers; +Cc: thekittendev, jroquet

Bart Schaefer wrote on Tue, 25 Sep 2018 22:32 -0700:
> You can also get forward motions by typing ESC - (that's two
> characters, escape and hypen (minus)) before typing the character for
> a backward motion, i.e., ESC - ^H deletes forward one character, ESC -
> ^W deletes forward one word.

For those of us who use EDITOR=vim with `bindkey -e`, where is it
documented that a numeric argument can be negative?  I couldn't find
that info in zshzle(1) or zshall(1).

Cheers,

Daniel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Suggestion: forward-delete-word
  2018-09-26 14:55     ` Daniel Shahaf
@ 2018-09-26 15:05       ` Mikael Magnusson
  2018-09-26 15:12         ` Daniel Shahaf
  0 siblings, 1 reply; 6+ messages in thread
From: Mikael Magnusson @ 2018-09-26 15:05 UTC (permalink / raw)
  To: Daniel Shahaf; +Cc: zsh workers, thekittendev, jroquet

On Wed, Sep 26, 2018 at 4:55 PM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> Bart Schaefer wrote on Tue, 25 Sep 2018 22:32 -0700:
>> You can also get forward motions by typing ESC - (that's two
>> characters, escape and hypen (minus)) before typing the character for
>> a backward motion, i.e., ESC - ^H deletes forward one character, ESC -
>> ^W deletes forward one word.
>
> For those of us who use EDITOR=vim with `bindkey -e`, where is it
> documented that a numeric argument can be negative?  I couldn't find
> that info in zshzle(1) or zshall(1).

       In many places, references are made to the
       numeric argument.  This can by default be
       entered in emacs mode by holding the alt
       key and typing a number, or pressing escape
       before each digit, and in vi command mode
       by typing the  number before  entering a
       command.   Generally  the  numeric  argument
       causes  the next command entered to be
       repeated the specified number of times,
       unless otherwise noted below. See  also  the
       Arguments subsection of the Widgets section
       for some other ways the numeric argument can
       be modified. The default bindings mentioned
       here use the digit-argument widget.


The referenced "Arguments" subsection containes the neg-argument
widget. Many individual widgets also mention exactly what happens when
given a numeric argument.

-- 
Mikael Magnusson

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Suggestion: forward-delete-word
  2018-09-26 15:05       ` Mikael Magnusson
@ 2018-09-26 15:12         ` Daniel Shahaf
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Shahaf @ 2018-09-26 15:12 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: zsh workers, thekittendev, jroquet

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

Mikael Magnusson wrote on Wed, 26 Sep 2018 17:05 +0200:
> On Wed, Sep 26, 2018 at 4:55 PM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > that info in zshzle(1) or zshall(1).
> 
>        In many places, references are made to the
>        numeric argument.  This can by default be
>        entered in emacs mode by holding the alt
>        key and typing a number, or pressing escape
>        before each digit, and in vi command mode
>        by typing the  number before  entering a
>        command.   Generally  the  numeric  argument
>        causes  the next command entered to be
>        repeated the specified number of times,
>        unless otherwise noted below. See  also  the
>        Arguments subsection of the Widgets section
>        for some other ways the numeric argument can
>        be modified. The default bindings mentioned
>        here use the digit-argument widget.
> 
> 
> The referenced "Arguments" subsection containes the neg-argument
> widget. Many individual widgets also mention exactly what happens when
> given a numeric argument.

Thanks --- I did read that section before posting, but the last sentence
led me to disregard keybindings not documented under digit-argument.
Docs patch attached :)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-zshzle-Clarify-sentence-in-introduction.patch --]
[-- Type: text/x-patch; name="0001-zshzle-Clarify-sentence-in-introduction.patch", Size: 1208 bytes --]

From 31657e8058b577e965d65fa18a7b2b937d82ff96 Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@daniel.shahaf.name>
Date: Wed, 26 Sep 2018 15:11:12 +0000
Subject: [PATCH] zshzle: Clarify sentence in introduction.

---
 Doc/Zsh/zle.yo | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 6ae4863c6..895c5c570 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -47,11 +47,11 @@ by default be entered in emacs mode by holding the alt key and typing
 a number, or pressing escape before each digit, and in vi command mode
 by typing the number before entering a command.  Generally the numeric
 argument causes the next command entered to be repeated the specified
-number of times, unless otherwise noted below. See also
+number of times, unless otherwise noted below; this is implemented
+by the tt(digit-argument) widget. See also
 ifzman(the em(Arguments) subsection of the em(Widgets) section )\
 ifnzman(noderef(Arguments) )\
-for some other ways the numeric argument can be modified. The default
-bindings mentioned here use the tt(digit-argument) widget.
+for some other ways the numeric argument can be modified.
 
 startmenu()
 menu(Keymaps)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-26 15:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24 18:29 Suggestion: forward-delete-word Noam Barnea
2018-09-24 18:59 ` Jérémie Roquet
2018-09-26  5:32   ` Bart Schaefer
2018-09-26 14:55     ` Daniel Shahaf
2018-09-26 15:05       ` Mikael Magnusson
2018-09-26 15:12         ` Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).