bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#56110: 27+; switching from line-mode to char-mode


From: Michael Heerdegen
Subject: bug#56110: 27+; switching from line-mode to char-mode
Date: Tue, 21 Jun 2022 13:47:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

"C. Michailidis" <signal3@gmail.com> writes:

> I recently updated a few machines and noticed that term.el in Emacs
> version 27+ forcibly submits my pasted commands to the shell sub-process
> when switching to char-mode (from line-mode). In prior versions of Emacs
> term.el didn't do this; I could further modify the command in char-mode
> even if it was pasted from line-mode and submit it myself by pressing
> enter.

Thanks for the report.

This issue is a side effect of this change:

5653b76d0b * lisp/term.el: Fix minor compilation issues with cl-lib and lexbind
Stefan Monnier <monnier@iro.umontreal.ca> 2019-02-24

When I revert the part that changes `term-char-mode':

From 3ebb78f622453623a406d4413cbee421ae57ad84 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@web.de>
Date: Tue, 21 Jun 2022 13:41:51 +0200
Subject: [PATCH] WIP: Fix 56110

---
 lisp/term.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lisp/term.el b/lisp/term.el
index 94bf13e973..eec78707e7 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1463,14 +1463,16 @@ term-char-mode
     (add-hook 'post-command-hook #'term-goto-process-mark-maybe nil t)

     ;; Send existing partial line to inferior (without newline).
-    (let ((pmark (process-mark (get-buffer-process (current-buffer)))))
+    (let ((pmark (process-mark (get-buffer-process (current-buffer))))
+         (save-input-sender term-input-sender))
       (when (> (point) pmark)
        (unwind-protect
            (progn
-             (add-function :override term-input-sender #'term-send-string)
+             (setq term-input-sender
+                   (symbol-function 'term-send-string))
              (end-of-line)
              (term-send-input))
-         (remove-function term-input-sender #'term-send-string))))
+         (setq term-input-sender save-input-sender))))
     (term-update-mode-line)))

 (defun term-line-mode  ()
--
2.30.2

the original behavior is restored.

Stefan, how would a fix look like that fits your intention?

TIA,

Michael.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]