git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg
@ 2019-04-08 12:54 Ismael Luceno Cortes
  2019-05-06 14:41 ` Ismael Luceno
  0 siblings, 1 reply; 7+ messages in thread
From: Ismael Luceno Cortes @ 2019-04-08 12:54 UTC (permalink / raw)
  To: git@vger.kernel.org
  Cc: Ismael Luceno Cortes, Junio C Hamano, brian m. carlson,
	Pat Thoyts

- Control+BackSpace: Delete word to the left of the cursor.
- Control+Delete   : Delete word to the right of the cursor.

Originally introduced by BRIEF and Turbo Vision between 1985 and 1992,
they were adopted by most CUA-Compliant UIs, including those of: OS/2,
Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs.

In both cases Tk already implements the functionality bound to other key
combination, so we use that.

Graphical examples:

Deleting to the left:
        v------ pointer
X_WORD____X
  ^-----^------ selection

Deleting to the right:
  v--------- pointer
X_WORD_X
  ^--^------ selection

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>

---

CC: Junio C Hamano <gitster@pobox.com>
CC: "brian m. carlson" <sandals@crustytoothpaste.net>
CC: Pat Thoyts <patthoyts@users.sourceforge.net>

Notes:
    Changes since v2:
    - Reimplemented via existing events, which correctly delete spaces.
    - Further improved commit message.
    
    Changes since v1:
    - Improved commit message.

 git-gui/git-gui.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 6de74ce639..c4e0270626 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -3812,6 +3812,8 @@ bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break}
 bind $ui_comm <$M1B-Key-equal> {show_more_context;break}
 bind $ui_comm <$M1B-Key-plus> {show_more_context;break}
 bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break}
+bind $ui_comm <Control-Key-BackSpace> {event generate %W <Meta-Delete>;break}
+bind $ui_comm <Control-Key-Delete> {event generate %W <Meta-d>;break}
 
 bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break}
 bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break}
-- 
2.19.1

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

* Re: [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg
  2019-04-08 12:54 Ismael Luceno Cortes
@ 2019-05-06 14:41 ` Ismael Luceno
  2019-05-27 19:37   ` Johannes Schindelin
  0 siblings, 1 reply; 7+ messages in thread
From: Ismael Luceno @ 2019-05-06 14:41 UTC (permalink / raw)
  To: git@vger.kernel.org; +Cc: Junio C Hamano, brian m. carlson, Pat Thoyts

On 08/Apr/2019 12:54, Ismael Luceno Cortes wrote:
> - Control+BackSpace: Delete word to the left of the cursor.
> - Control+Delete   : Delete word to the right of the cursor.
> 
> Originally introduced by BRIEF and Turbo Vision between 1985 and 1992,
> they were adopted by most CUA-Compliant UIs, including those of: OS/2,
> Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs.
> 
> In both cases Tk already implements the functionality bound to other key
> combination, so we use that.
<...>

Ping.

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

* Re: [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg
  2019-05-06 14:41 ` Ismael Luceno
@ 2019-05-27 19:37   ` Johannes Schindelin
  0 siblings, 0 replies; 7+ messages in thread
From: Johannes Schindelin @ 2019-05-27 19:37 UTC (permalink / raw)
  To: Ismael Luceno
  Cc: git@vger.kernel.org, Junio C Hamano, brian m. carlson, Pat Thoyts

Hi,

On Mon, 6 May 2019, Ismael Luceno wrote:

> On 08/Apr/2019 12:54, Ismael Luceno Cortes wrote:
> > - Control+BackSpace: Delete word to the left of the cursor.
> > - Control+Delete   : Delete word to the right of the cursor.
> >
> > Originally introduced by BRIEF and Turbo Vision between 1985 and 1992,
> > they were adopted by most CUA-Compliant UIs, including those of: OS/2,
> > Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs.
> >
> > In both cases Tk already implements the functionality bound to other key
> > combination, so we use that.
> <...>
>
> Ping.

FWIW I am in favor of this patch. It is simple enough, and the commit
message does a good job explaining why it is a good idea to do it.

It's too bad that we do not have any active Git GUI maintainer... :-(

Ciao,
Johannes

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

* [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg
@ 2020-05-12 10:28 Ismael Luceno
  2020-05-12 13:02 ` Pratyush Yadav
  2020-05-21 13:00 ` Pratyush Yadav
  0 siblings, 2 replies; 7+ messages in thread
From: Ismael Luceno @ 2020-05-12 10:28 UTC (permalink / raw)
  To: git@vger.kernel.org
  Cc: Junio C Hamano, brian m. carlson, Pat Thoyts, Johannes Schindelin

From: Ismael Luceno <ismael.luceno@tttech-auto.com>

- Control+BackSpace: Delete word to the left of the cursor.
- Control+Delete   : Delete word to the right of the cursor.

Originally introduced by BRIEF and Turbo Vision between 1985 and 1992,
they were adopted by most CUA-Compliant UIs, including those of: OS/2,
Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs.

In both cases Tk already implements the functionality bound to other key
combination, so we use that.

Graphical examples:

Deleting to the left:
        v------ pointer
X_WORD____X
  ^-----^------ selection

Deleting to the right:
  v--------- pointer
X_WORD_X
  ^--^------ selection

Signed-off-by: Ismael Luceno <ismael.luceno@tttech-auto.com>

---
I'm re-submitting the patch after >1 year.

CC: Junio C Hamano <gitster@pobox.com>
CC: "brian m. carlson" <sandals@crustytoothpaste.net>
CC: Pat Thoyts <patthoyts@users.sourceforge.net>
CC: Johannes Schindelin <Johannes.Schindelin@gmx.de>

Notes:
    Changes since v2:
    - Reimplemented via existing events, which correctly delete spaces.
    - Further improved commit message.
    
    Changes since v1:
    - Improved commit message.

 git-gui/git-gui.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 6de74ce639..c4e0270626 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -3812,6 +3812,8 @@ bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break}
 bind $ui_comm <$M1B-Key-equal> {show_more_context;break}
 bind $ui_comm <$M1B-Key-plus> {show_more_context;break}
 bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break}
+bind $ui_comm <Control-Key-BackSpace> {event generate %W <Meta-Delete>;break}
+bind $ui_comm <Control-Key-Delete> {event generate %W <Meta-d>;break}
 
 bind $ui_diff <$M1B-Key-x> {tk_textCopy %W;break}
 bind $ui_diff <$M1B-Key-X> {tk_textCopy %W;break}
-- 
2.19.1

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

* Re: [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg
  2020-05-12 10:28 [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg Ismael Luceno
@ 2020-05-12 13:02 ` Pratyush Yadav
  2020-05-12 13:28   ` Ismael Luceno
  2020-05-21 13:00 ` Pratyush Yadav
  1 sibling, 1 reply; 7+ messages in thread
From: Pratyush Yadav @ 2020-05-12 13:02 UTC (permalink / raw)
  To: Ismael Luceno
  Cc: git@vger.kernel.org, Junio C Hamano, brian m. carlson, Pat Thoyts,
	Johannes Schindelin

Hi Ismael,

On 12/05/20 12:28PM, Ismael Luceno wrote:
> From: Ismael Luceno <ismael.luceno@tttech-auto.com>
> 
> - Control+BackSpace: Delete word to the left of the cursor.
> - Control+Delete   : Delete word to the right of the cursor.
> 
> Originally introduced by BRIEF and Turbo Vision between 1985 and 1992,
> they were adopted by most CUA-Compliant UIs, including those of: OS/2,
> Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs.
> 
> In both cases Tk already implements the functionality bound to other key
> combination, so we use that.
> 
> Graphical examples:
> 
> Deleting to the left:
>         v------ pointer
> X_WORD____X
>   ^-----^------ selection
> 
> Deleting to the right:
>   v--------- pointer
> X_WORD_X
>   ^--^------ selection
> 
> Signed-off-by: Ismael Luceno <ismael.luceno@tttech-auto.com>
> 
> ---
> I'm re-submitting the patch after >1 year.
> 
> CC: Junio C Hamano <gitster@pobox.com>
> CC: "brian m. carlson" <sandals@crustytoothpaste.net>
> CC: Pat Thoyts <patthoyts@users.sourceforge.net>
> CC: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> 
> Notes:
>     Changes since v2:
>     - Reimplemented via existing events, which correctly delete spaces.
>     - Further improved commit message.
>     
>     Changes since v1:
>     - Improved commit message.
> 
>  git-gui/git-gui.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> index 6de74ce639..c4e0270626 100755
> --- a/git-gui/git-gui.sh
> +++ b/git-gui/git-gui.sh

You based the patch on top of the Git tree. Since Git Gui is maintained 
separate from Git, patches are expected to be based on top of the Git 
Gui tree [0]. I fixed it up and applied the patch on my tree.

> @@ -3812,6 +3812,8 @@ bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break}
>  bind $ui_comm <$M1B-Key-equal> {show_more_context;break}
>  bind $ui_comm <$M1B-Key-plus> {show_more_context;break}
>  bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break}
> +bind $ui_comm <Control-Key-BackSpace> {event generate %W <Meta-Delete>;break}
> +bind $ui_comm <Control-Key-Delete> {event generate %W <Meta-d>;break}

Don't use "Control" directly to maintain compatibility with MacOS. Use 
$M1B like the surrounding code does. I fixed it up locally, so no need 
to send in a new version. You can find the fixed up version here [1]. 
Test it if you'd like.

Will merge it in. Thanks.
  
[0] https://github.com/prati0100/git-gui/
[1] https://github.com/prati0100/git-gui/tree/il/ctrl-bs-del

-- 
Regards,
Pratyush Yadav

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

* Re: [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg
  2020-05-12 13:02 ` Pratyush Yadav
@ 2020-05-12 13:28   ` Ismael Luceno
  0 siblings, 0 replies; 7+ messages in thread
From: Ismael Luceno @ 2020-05-12 13:28 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: git@vger.kernel.org, Junio C Hamano, brian m. carlson, Pat Thoyts,
	Johannes Schindelin

On 12/May/2020 18:32, Pratyush Yadav wrote:
> Hi Ismael,
> 
> On 12/05/20 12:28PM, Ismael Luceno wrote:
> > From: Ismael Luceno <ismael.luceno@tttech-auto.com>
> > 
> > - Control+BackSpace: Delete word to the left of the cursor.
> > - Control+Delete   : Delete word to the right of the cursor.
> > 
> > Originally introduced by BRIEF and Turbo Vision between 1985 and 1992,
> > they were adopted by most CUA-Compliant UIs, including those of: OS/2,
> > Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs.
> > 
> > In both cases Tk already implements the functionality bound to other key
> > combination, so we use that.
> > 
> > Graphical examples:
> > 
> > Deleting to the left:
> >         v------ pointer
> > X_WORD____X
> >   ^-----^------ selection
> > 
> > Deleting to the right:
> >   v--------- pointer
> > X_WORD_X
> >   ^--^------ selection
> > 
> > Signed-off-by: Ismael Luceno <ismael.luceno@tttech-auto.com>
> > 
> > ---
> > I'm re-submitting the patch after >1 year.
> > 
> > CC: Junio C Hamano <gitster@pobox.com>
> > CC: "brian m. carlson" <sandals@crustytoothpaste.net>
> > CC: Pat Thoyts <patthoyts@users.sourceforge.net>
> > CC: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> > 
> > Notes:
> >     Changes since v2:
> >     - Reimplemented via existing events, which correctly delete spaces.
> >     - Further improved commit message.
> >     
> >     Changes since v1:
> >     - Improved commit message.
> > 
> >  git-gui/git-gui.sh | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> > index 6de74ce639..c4e0270626 100755
> > --- a/git-gui/git-gui.sh
> > +++ b/git-gui/git-gui.sh
> 
> You based the patch on top of the Git tree. Since Git Gui is maintained 
> separate from Git, patches are expected to be based on top of the Git 
> Gui tree [0]. I fixed it up and applied the patch on my tree.
> 
> > @@ -3812,6 +3812,8 @@ bind $ui_comm <$M1B-Key-KP_Subtract> {show_less_context;break}
> >  bind $ui_comm <$M1B-Key-equal> {show_more_context;break}
> >  bind $ui_comm <$M1B-Key-plus> {show_more_context;break}
> >  bind $ui_comm <$M1B-Key-KP_Add> {show_more_context;break}
> > +bind $ui_comm <Control-Key-BackSpace> {event generate %W <Meta-Delete>;break}
> > +bind $ui_comm <Control-Key-Delete> {event generate %W <Meta-d>;break}
> 
> Don't use "Control" directly to maintain compatibility with MacOS. Use 
> $M1B like the surrounding code does. I fixed it up locally, so no need 
> to send in a new version. You can find the fixed up version here [1]. 
> Test it if you'd like.
> 
> Will merge it in. Thanks.

Thanks.

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

* Re: [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg
  2020-05-12 10:28 [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg Ismael Luceno
  2020-05-12 13:02 ` Pratyush Yadav
@ 2020-05-21 13:00 ` Pratyush Yadav
  1 sibling, 0 replies; 7+ messages in thread
From: Pratyush Yadav @ 2020-05-21 13:00 UTC (permalink / raw)
  To: Ismael Luceno
  Cc: git@vger.kernel.org, Junio C Hamano, brian m. carlson, Pat Thoyts,
	Johannes Schindelin

On 12/05/20 12:28PM, Ismael Luceno wrote:
> From: Ismael Luceno <ismael.luceno@tttech-auto.com>
> 
> - Control+BackSpace: Delete word to the left of the cursor.
> - Control+Delete   : Delete word to the right of the cursor.
> 
> Originally introduced by BRIEF and Turbo Vision between 1985 and 1992,
> they were adopted by most CUA-Compliant UIs, including those of: OS/2,
> Windows, Mac OS, Qt, GTK, Open/Libre Office, Gecko, and GNU Emacs.
> 
> In both cases Tk already implements the functionality bound to other key
> combination, so we use that.
> 
> Graphical examples:
> 
> Deleting to the left:
>         v------ pointer
> X_WORD____X
>   ^-----^------ selection
> 
> Deleting to the right:
>   v--------- pointer
> X_WORD_X
>   ^--^------ selection
> 
> Signed-off-by: Ismael Luceno <ismael.luceno@tttech-auto.com>

Merged to git-gui/master.
 

-- 
Regards,
Pratyush Yadav

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

end of thread, other threads:[~2020-05-21 13:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 10:28 [PATCH v3] git-gui: Handle Ctrl + BS/Del in the commit msg Ismael Luceno
2020-05-12 13:02 ` Pratyush Yadav
2020-05-12 13:28   ` Ismael Luceno
2020-05-21 13:00 ` Pratyush Yadav
  -- strict thread matches above, loose matches on Subject: below --
2019-04-08 12:54 Ismael Luceno Cortes
2019-05-06 14:41 ` Ismael Luceno
2019-05-27 19:37   ` Johannes Schindelin

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

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).