GNU bug report logs - #69819
30.0.50; comint-mode does not always respect the read-only flag

Previous Next

Package: emacs;

Reported by: Dima Kogan <dima <at> secretsauce.net>

Date: Fri, 15 Mar 2024 20:09:02 UTC

Severity: normal

Found in version 30.0.50

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dima Kogan <dima <at> secretsauce.net>
Cc: 69819 <at> debbugs.gnu.org
Subject: Re: bug#69819: 30.0.50; comint-mode does not always respect the
 read-only flag
Date: Mon, 18 Mar 2024 15:16:49 +0200
> From: Dima Kogan <dima <at> secretsauce.net>
> Cc: 69819 <at> debbugs.gnu.org
> Date: Sun, 17 Mar 2024 21:57:26 -0700
> 
> > What expectation, exactly? The buffer is not changed; the process is
> > terminated, but that's not the same as changing the process's buffer!
> 
> The buffer IS changed, actually: when the inferior process dies, it
> prints a message into the buffer:
> 
>   Process shell<1> finished

Not relevant: this comes from the process sentinel, which is invoked
when the process exits.  By that time, the buffer is no long a shell
buffer, and the process finished notification is shown to announce the
end of the session.

> My use case is this. I use shell-mode buffers extensively. Periodically
> I want to examine the output of some command in a *shell* buffer:
> compare it against other data, look at it, cut/paste it, whatever. While
> I'm doing that I don't want to accidentally change anything, so I C-x
> C-q. Then accidental keystrokes don't end up changing anything. UNLESS
> that accidental keystroke is C-d (and probably a few others I haven't
> hit by mistake yet). This use case and expectation seems reasonable to
> me.

I don't agree that it is reasonable.  C-d is a key that is bound to a
certain function, not unlike C-f or C-v.  You wouldn't expect C-f or
C-v not do their job when a buffer is read-only, would you?  Then why
expect that from C-d?

As for your use case: I understand now where you are coming from, but
I think that what you want is a missing feature; that it just happens
to work with 99% of your keystrokes is sheer luck.  What you want is a
feature whereby input to the shell is blocked until explicitly
unblocked by the user, in which case C-d would be blocked as well.  I
don't think we have such a feature, so I propose to add it.




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

Previous Next


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