all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#59144: [PATCH] Add repeat-map for comint and eshell
@ 2022-11-09  6:16 Brian Leung
  2022-11-09  6:47 ` Jim Porter
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Leung @ 2022-11-09  6:16 UTC (permalink / raw)
  To: 59144

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

Tags: patch





In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
version 1.16.0, Xaw3d scroll bars)
Repository revision: 68e2a9cd92996dd55ff9599dc1bf99c70070cddb
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: NixOS 22.11 (Raccoon)

Configured using:
 'configure
 --prefix=/nix/store/1bs9w4lkx78fsln68yg51y5i8a1czfjj-emacs-git-20221108.0
 --disable-build-details --with-modules --with-x-toolkit=lucid
 --with-xft --with-cairo --with-native-compilation'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-comint-Add-repeat-map-for-comint.patch --]
[-- Type: text/patch, Size: 968 bytes --]

From 50a276b3839569c6c9f61e81e1771e958e7fd9c0 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Tue, 8 Nov 2022 22:03:29 -0800
Subject: [PATCH 1/2] comint: Add repeat-map for comint

* lisp/comint.el (comint-repeat-map): New keymap.
---
 lisp/comint.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/comint.el b/lisp/comint.el
index 07ced8d321..93b97cb22b 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -604,6 +604,14 @@ comint-mode-map
 				       menu-bar-final-items))
     map))
 
+(defvar-keymap comint-repeat-map
+  :doc "Keymap to repeat comint key sequences.  Used in `repeat-mode'."
+  "C-n" #'comint-next-prompt
+  "C-p" #'comint-previous-prompt)
+
+(put #'comint-next-prompt 'repeat-map 'comint-repeat-map)
+(put #'comint-previous-prompt 'repeat-map 'comint-repeat-map)
+
 ;; Fixme: Is this still relevant?
 (defvar comint-ptyp t
   "Non-nil if communications via pty; false if by pipe.  Buffer local.
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-em-prompt-Add-repeat-map-for-em-prompt.patch --]
[-- Type: text/patch, Size: 1030 bytes --]

From 0fa475101f29c7e2984b23dc490b7d6d593a98d1 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Tue, 8 Nov 2022 22:11:15 -0800
Subject: [PATCH 2/2] em-prompt: Add repeat-map for em-prompt

* lisp/eshell/em-prompt.el (eshell-prompt-repeat-map): New keymap.
---
 lisp/eshell/em-prompt.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index a1a91e7d63..a8744de1db 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -100,6 +100,14 @@ eshell-prompt-mode-map
   "C-c C-n" #'eshell-next-prompt
   "C-c C-p" #'eshell-previous-prompt)
 
+(defvar-keymap eshell-prompt-repeat-map
+  :doc "Keymap to repeat eshell-prompt key sequences.  Used in `repeat-mode'."
+  "C-n" #'eshell-next-prompt
+  "C-p" #'eshell-previous-prompt)
+
+(put #'eshell-next-prompt 'repeat-map 'eshell-prompt-repeat-map)
+(put #'eshell-previous-prompt 'repeat-map 'eshell-prompt-repeat-map)
+
 ;;; Functions:
 
 (define-minor-mode eshell-prompt-mode
-- 
2.38.1


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

* bug#59144: [PATCH] Add repeat-map for comint and eshell
  2022-11-09  6:16 bug#59144: [PATCH] Add repeat-map for comint and eshell Brian Leung
@ 2022-11-09  6:47 ` Jim Porter
  2022-11-09  7:19   ` Brian Leung
  0 siblings, 1 reply; 5+ messages in thread
From: Jim Porter @ 2022-11-09  6:47 UTC (permalink / raw)
  To: Brian Leung, 59144

On 11/8/2022 10:16 PM, Brian Leung wrote:
> Tags: patch

Thanks. For Eshell, there are a few other commands that might make sense 
to have repeat-maps. For example, 'eshell-forward-argument' (see 
'eshell-command-map' in esh-mode.el). These are defined differently, but 
hopefully repeat-mode can handle them...






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

* bug#59144: [PATCH] Add repeat-map for comint and eshell
  2022-11-09  6:47 ` Jim Porter
@ 2022-11-09  7:19   ` Brian Leung
  2022-11-09  7:27     ` Brian Leung
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Leung @ 2022-11-09  7:19 UTC (permalink / raw)
  To: Jim Porter; +Cc: 59144

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

> On 11/8/2022 10:16 PM, Brian Leung wrote:
>> Tags: patch
>
> Thanks. For Eshell, there are a few other commands that might 
> make
> sense to have repeat-maps. For example, 
> 'eshell-forward-argument' (see
> 'eshell-command-map' in esh-mode.el). These are defined 
> differently,
> but hopefully repeat-mode can handle them...

OK, see attached for additional Eshell and shell patches.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: eshell --]
[-- Type: text/x-patch, Size: 1061 bytes --]

From 20f3c46b7475aa640d8af2d1f2c6384ffeb1c5fc Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Tue, 8 Nov 2022 23:16:16 -0800
Subject: [PATCH 1/2] esh-mode: Add repeat-map for
 eshell-{forward,backward}-argument

* lisp/eshell/esh-mode.el (eshell-command-repeat-map): New defvar.
---
 lisp/eshell/esh-mode.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 92523fd99e..4357a0e29a 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -280,6 +280,14 @@ eshell-command-map
   "C-w" #'backward-kill-word
   "C-y" #'eshell-repeat-argument)
 
+(defvar-keymap eshell-command-repeat-map
+  :doc "Keymap to repeat eshell-command key sequences.  Used in `repeat-mode'."
+  "C-f" #'eshell-forward-argument
+  "C-b" #'eshell-backward-argument)
+
+(put #'eshell-forward-argument 'repeat-map 'eshell-command-repeat-map)
+(put #'eshell-backward-argument 'repeat-map 'eshell-command-repeat-map)
+
 ;;; User Functions:
 
 (defun eshell-kill-buffer-function ()
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: shell --]
[-- Type: text/x-patch, Size: 940 bytes --]

From 645aa7e78991adcf32dc4467ab397762f90fc859 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Tue, 8 Nov 2022 23:18:23 -0800
Subject: [PATCH 2/2] shell: Add repeat-map for shell-{forward,backward}-prompt

* lisp/shell.el (shell-repeat-map): New defvar.
---
 lisp/shell.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/shell.el b/lisp/shell.el
index 641f274045..180a338216 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -393,6 +393,14 @@ shell-mode-map
       'complete-expand)
     map))
 
+(defvar-keymap shell-repeat-map
+  :doc "Keymap to repeat eshell-command key sequences.  Used in `repeat-mode'."
+  "C-f" #'shell-forward-command
+  "C-b" #'shell-backward-command)
+
+(put #'shell-forward-command 'repeat-map 'shell-repeat-map)
+(put #'shell-backward-command 'repeat-map 'shell-repeat-map)
+
 (defcustom shell-mode-hook '()
   "Hook for customizing Shell mode."
   :type 'hook
-- 
2.38.1


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

* bug#59144: [PATCH] Add repeat-map for comint and eshell
  2022-11-09  7:19   ` Brian Leung
@ 2022-11-09  7:27     ` Brian Leung
  2022-11-17  9:37       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Leung @ 2022-11-09  7:27 UTC (permalink / raw)
  To: Jim Porter; +Cc: 59144

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

Revised the commits. I reworded some commit messages and fixed a 
docstring typo.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: comint --]
[-- Type: text/x-patch, Size: 991 bytes --]

From 55663ae863d04e9e2d94bdc51b01fb1a4e2cc982 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Tue, 8 Nov 2022 22:03:29 -0800
Subject: [PATCH 1/4] comint: Add repeat-map for comint-{next,previous}-prompt

* lisp/comint.el (comint-repeat-map): New keymap.
---
 lisp/comint.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/comint.el b/lisp/comint.el
index 07ced8d321..93b97cb22b 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -604,6 +604,14 @@ comint-mode-map
 				       menu-bar-final-items))
     map))
 
+(defvar-keymap comint-repeat-map
+  :doc "Keymap to repeat comint key sequences.  Used in `repeat-mode'."
+  "C-n" #'comint-next-prompt
+  "C-p" #'comint-previous-prompt)
+
+(put #'comint-next-prompt 'repeat-map 'comint-repeat-map)
+(put #'comint-previous-prompt 'repeat-map 'comint-repeat-map)
+
 ;; Fixme: Is this still relevant?
 (defvar comint-ptyp t
   "Non-nil if communications via pty; false if by pipe.  Buffer local.
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: em-prompt --]
[-- Type: text/x-patch, Size: 1051 bytes --]

From bda7857dfae7b92137b9bb67706599940f65a6c2 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Tue, 8 Nov 2022 22:11:15 -0800
Subject: [PATCH 2/4] em-prompt: Add repeat-map for
 eshell-{next,previous}-prompt

* lisp/eshell/em-prompt.el (eshell-prompt-repeat-map): New keymap.
---
 lisp/eshell/em-prompt.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el
index a1a91e7d63..a8744de1db 100644
--- a/lisp/eshell/em-prompt.el
+++ b/lisp/eshell/em-prompt.el
@@ -100,6 +100,14 @@ eshell-prompt-mode-map
   "C-c C-n" #'eshell-next-prompt
   "C-c C-p" #'eshell-previous-prompt)
 
+(defvar-keymap eshell-prompt-repeat-map
+  :doc "Keymap to repeat eshell-prompt key sequences.  Used in `repeat-mode'."
+  "C-n" #'eshell-next-prompt
+  "C-p" #'eshell-previous-prompt)
+
+(put #'eshell-next-prompt 'repeat-map 'eshell-prompt-repeat-map)
+(put #'eshell-previous-prompt 'repeat-map 'eshell-prompt-repeat-map)
+
 ;;; Functions:
 
 (define-minor-mode eshell-prompt-mode
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: esh-mode --]
[-- Type: text/x-patch, Size: 1061 bytes --]

From 565fc60e55813caefe431f34f08befd47f15a073 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Tue, 8 Nov 2022 23:16:16 -0800
Subject: [PATCH 3/4] esh-mode: Add repeat-map for
 eshell-{forward,backward}-argument

* lisp/eshell/esh-mode.el (eshell-command-repeat-map): New defvar.
---
 lisp/eshell/esh-mode.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index 92523fd99e..4357a0e29a 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -280,6 +280,14 @@ eshell-command-map
   "C-w" #'backward-kill-word
   "C-y" #'eshell-repeat-argument)
 
+(defvar-keymap eshell-command-repeat-map
+  :doc "Keymap to repeat eshell-command key sequences.  Used in `repeat-mode'."
+  "C-f" #'eshell-forward-argument
+  "C-b" #'eshell-backward-argument)
+
+(put #'eshell-forward-argument 'repeat-map 'eshell-command-repeat-map)
+(put #'eshell-backward-argument 'repeat-map 'eshell-command-repeat-map)
+
 ;;; User Functions:
 
 (defun eshell-kill-buffer-function ()
-- 
2.38.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: shell --]
[-- Type: text/x-patch, Size: 931 bytes --]

From 5bfa2e7c267b52c1cc59eb965850aac239a6eb0c Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Tue, 8 Nov 2022 23:18:23 -0800
Subject: [PATCH 4/4] shell: Add repeat-map for shell-{forward,backward}-prompt

* lisp/shell.el (shell-repeat-map): New defvar.
---
 lisp/shell.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/shell.el b/lisp/shell.el
index 641f274045..7c3c925ab8 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -393,6 +393,14 @@ shell-mode-map
       'complete-expand)
     map))
 
+(defvar-keymap shell-repeat-map
+  :doc "Keymap to repeat shell key sequences.  Used in `repeat-mode'."
+  "C-f" #'shell-forward-command
+  "C-b" #'shell-backward-command)
+
+(put #'shell-forward-command 'repeat-map 'shell-repeat-map)
+(put #'shell-backward-command 'repeat-map 'shell-repeat-map)
+
 (defcustom shell-mode-hook '()
   "Hook for customizing Shell mode."
   :type 'hook
-- 
2.38.1


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

* bug#59144: [PATCH] Add repeat-map for comint and eshell
  2022-11-09  7:27     ` Brian Leung
@ 2022-11-17  9:37       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2022-11-17  9:37 UTC (permalink / raw)
  To: Brian Leung; +Cc: jporterbugs, 59144-done

> Cc: 59144@debbugs.gnu.org
> From: Brian Leung <leungbk@posteo.net>
> Date: Wed, 09 Nov 2022 07:27:40 +0000
> 
> Revised the commits. I reworded some commit messages and fixed a 
> docstring typo.

Thanks, installed, and closing the bug.





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

end of thread, other threads:[~2022-11-17  9:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09  6:16 bug#59144: [PATCH] Add repeat-map for comint and eshell Brian Leung
2022-11-09  6:47 ` Jim Porter
2022-11-09  7:19   ` Brian Leung
2022-11-09  7:27     ` Brian Leung
2022-11-17  9:37       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.