GNU bug report logs - #69078
[PATCH] esh-mode: Allow eshell-kill-output to actually kill the output.

Previous Next

Package: emacs;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Mon, 12 Feb 2024 16:26:02 UTC

Severity: normal

Tags: patch

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69078 in the body.
You can then email your comments to 69078 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#69078; Package emacs. (Mon, 12 Feb 2024 16:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 12 Feb 2024 16:26:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: bug-gnu-emacs <at> gnu.org
Cc: Tomas Volf <~@wolfsden.cz>
Subject: [PATCH] esh-mode: Allow eshell-kill-output to actually kill the
 output.
Date: Mon, 12 Feb 2024 17:22:39 +0100
Before this commit, the function eshell-kill-output, despite the name,
did not allow to kill the output, it always just deleted it.  This
commit fixes that, allowing to do the kill with C-u.

This mimics how comint mode operates, so from this commit C-c C-o and
C-u C-c C-o will work the same way in eshell-mode and shell-mode.

* lisp/eshell/esh-mode.el (eshell-kill-output): New optional argument,
kill.
---
The function name is misleading (and in comint is is called
coming-delete-output), but changing it could break code, so I do not think it is
worth it.  Adding the argument should be enough.

I do not have a copyright assignment, however the change is trivial, and mostly
copied from comint-delete-output, so I do not think it is necessary.

 lisp/eshell/esh-mode.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index fd279f61673..882fc67b9a1 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -832,13 +832,18 @@ This function should be in the list `eshell-output-filter-functions'."
       eshell-last-output-start
     eshell-last-output-end))

-(defun eshell-kill-output ()
-  "Kill all output from interpreter since last input.
-Does not delete the prompt."
-  (interactive)
+(defun eshell-kill-output (&optional kill)
+  "Delete all output from interpreter since last input.
+If KILL (interactively, the prefix), save the killed text in the
+kill ring.
+
+This command does not delete the prompt."
+  (interactive "P")
   (save-excursion
     (goto-char (eshell-beginning-of-output))
     (insert "*** output flushed ***\n")
+    (when kill
+      (copy-region-as-kill (point) (eshell-end-of-output)))
     (delete-region (point) (eshell-end-of-output))))

 (defun eshell-show-output (&optional arg)
--
2.41.0




Reply sent to Jim Porter <jporterbugs <at> gmail.com>:
You have taken responsibility. (Fri, 16 Feb 2024 02:30:02 GMT) Full text and rfc822 format available.

Notification sent to Tomas Volf <~@wolfsden.cz>:
bug acknowledged by developer. (Fri, 16 Feb 2024 02:30:02 GMT) Full text and rfc822 format available.

Message #10 received at 69078-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Tomas Volf <~@wolfsden.cz>, 69078-done <at> debbugs.gnu.org
Subject: Re: bug#69078: [PATCH] esh-mode: Allow eshell-kill-output to actually
 kill the output.
Date: Thu, 15 Feb 2024 18:27:34 -0800
On 2/12/2024 8:22 AM, Tomas Volf wrote:
> Before this commit, the function eshell-kill-output, despite the name,
> did not allow to kill the output, it always just deleted it.  This
> commit fixes that, allowing to do the kill with C-u.

Thanks for noticing this. This makes sense to me, so I've merged it to 
the master branch as 572d58b5e8d.

> The function name is misleading (and in comint is is called
> coming-delete-output), but changing it could break code, so I do not think it is
> worth it.  Adding the argument should be enough.

I also fixed this, but added an obsolete alias for the old name. That 
way, it won't break anything, and we can be a little more consistent 
with comint.

Closing this bug now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 15 Mar 2024 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.