unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: "Emacs-devel@gnu.org" <Emacs-devel@gnu.org>
Subject: [PATCH] Don't override 'comint-prompt-read-only' by default
Date: Fri, 13 Sep 2024 17:35:37 +0000	[thread overview]
Message-ID: <87a5gb4fti.fsf@posteo.net> (raw)

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


I am proposing this change here, because I am aware it might be
controversial.  My motivation is to have more consistent inferior modes,
and not have to be surprised that (as in my case right now,
inferior-python-mode doesn't allow be to kill a prompt).  I haven't
written a NEWS entry yet, but it should probably mention that anyone
interested in restoring the old behaviour should just set
'comint-prompt-read-only' directly.

WDYT?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Don't override 'comint-prompt-read-only' by default --]
[-- Type: text/x-patch, Size: 3600 bytes --]

From c6240fb0f0d9932fb0986ee2426162b90b99b633 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@posteo.net>
Date: Fri, 13 Sep 2024 19:32:55 +0200
Subject: [PATCH] Don't override 'comint-prompt-read-only' by default

* lisp/cmuscheme.el (inferior-scheme-mode): Remove 'setq-local'.
* lisp/ielm.el (ielm-prompt-read-only): Inherit default from
'comint-prompt-read-only'.
* lisp/progmodes/lua-ts-mode.el (lua-ts-inferior-lua): Remove
'setq-local'.
* lisp/progmodes/php-ts-mode.el (inferior-php-ts-mode): Remove
'setq-local'.
* lisp/progmodes/python.el (inferior-python-mode): Remove
'setq-local'.
---
 lisp/cmuscheme.el             | 1 -
 lisp/ielm.el                  | 2 +-
 lisp/progmodes/lua-ts-mode.el | 1 -
 lisp/progmodes/php-ts-mode.el | 1 -
 lisp/progmodes/python.el      | 1 -
 5 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el
index d4316fb1175..912fe6b8eca 100644
--- a/lisp/cmuscheme.el
+++ b/lisp/cmuscheme.el
@@ -195,7 +195,6 @@ inferior-scheme-mode
   (scheme-mode-variables)
   (setq mode-line-process '(":%s"))
   (setq comint-input-filter (function scheme-input-filter))
-  (setq-local comint-prompt-read-only t)
   (setq comint-get-old-input (function scheme-get-old-input)))
 
 (defcustom inferior-scheme-filter-regexp "\\`\\s *\\S ?\\S ?\\s *\\'"
diff --git a/lisp/ielm.el b/lisp/ielm.el
index e583e0fe32c..1b8702abc1f 100644
--- a/lisp/ielm.el
+++ b/lisp/ielm.el
@@ -46,7 +46,7 @@ ielm-noisy
   "If non-nil, IELM will beep on error."
   :type 'boolean)
 
-(defcustom ielm-prompt-read-only t
+(defcustom ielm-prompt-read-only comint-prompt-read-only
   "If non-nil, the IELM prompt is read only.
 The read only region includes the newline before the prompt.
 Setting this variable does not affect existing IELM runs.
diff --git a/lisp/progmodes/lua-ts-mode.el b/lisp/progmodes/lua-ts-mode.el
index 06daadbc1fd..2d039424a2f 100644
--- a/lisp/progmodes/lua-ts-mode.el
+++ b/lisp/progmodes/lua-ts-mode.el
@@ -645,7 +645,6 @@ lua-ts-inferior-lua
     (with-current-buffer lua-ts-inferior-buffer
       (setq-local comint-input-ignoredups t
                   comint-input-ring-file-name lua-ts-inferior-history
-                  comint-prompt-read-only t
                   comint-prompt-regexp (rx-to-string `(: bol
                                                          ,lua-ts-inferior-prompt
                                                          (1+ space))))
diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el
index 3f89de14075..e3d14bd563c 100644
--- a/lisp/progmodes/php-ts-mode.el
+++ b/lisp/progmodes/php-ts-mode.el
@@ -1563,7 +1563,6 @@ inferior-php-ts-mode
   (setq-local scroll-conservatively 1
               comint-input-ring-file-name php-ts-mode-inferior-history
               comint-input-ignoredups t
-              comint-prompt-read-only t
               comint-use-prompt-regexp t
               comint-prompt-regexp (concat "^" php-ts-mode--inferior-prompt " "))
   (comint-read-input-ring t))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 669638544ce..17563d29c63 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3672,7 +3672,6 @@ inferior-python-mode
   (setq-local python-shell--prompt-calculated-output-regexp nil)
   (python-shell-prompt-set-calculated-regexps)
   (setq comint-prompt-regexp python-shell--prompt-calculated-input-regexp)
-  (setq-local comint-prompt-read-only t)
   (setq mode-line-process '(":%s"))
   (setq-local comint-output-filter-functions
               '(ansi-color-process-output
-- 
2.45.2


[-- Attachment #3: Type: text/plain, Size: 34 bytes --]


-- 
	Philip Kaludercic on siskin

             reply	other threads:[~2024-09-13 17:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-13 17:35 Philip Kaludercic [this message]
2024-09-14 23:13 ` [PATCH] Don't override 'comint-prompt-read-only' by default Stefan Kangas
2024-09-15  0:31   ` Dmitry Gutov
2024-09-15 15:48   ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5gb4fti.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=Emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).