GNU bug report logs - #17666
24.3.91; [regression] call-process in read-only buffers

Previous Next

Package: emacs;

Reported by: "Roland Winkler" <winkler <at> gnu.org>

Date: Mon, 2 Jun 2014 15:03:02 UTC

Severity: normal

Found in version 24.3.91

Done: "Roland Winkler" <winkler <at> gnu.org>

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 17666 in the body.
You can then email your comments to 17666 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#17666; Package emacs. (Mon, 02 Jun 2014 15:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Roland Winkler" <winkler <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 02 Jun 2014 15:03:03 GMT) Full text and rfc822 format available.

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

From: "Roland Winkler" <winkler <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.91; [regression] call-process in read-only buffers
Date: Mon, 02 Jun 2014 10:01:52 -0500
evaluate the following with emacs -Q

;; running a process with no output via call-process
;; in any read-only buffer will do
(with-temp-buffer
  (let ((buffer-read-only t))
    (call-process "true" nil t)))

No problem with emacs 24.3

24.3.91:  Buffer is read-only: #<killed buffer>



In GNU Emacs 24.3.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2)
 of 2014-05-12 on regnitz
Windowing system distributor `The X.Org Foundation', version 11.0.11103000
System Description:	Ubuntu 12.04.4 LTS

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.ISO-8859-15
  locale-coding-system: iso-latin-9-unix

Major mode: Lisp Interaction




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17666; Package emacs. (Mon, 02 Jun 2014 16:19:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 17666 <at> debbugs.gnu.org
Subject: Re: bug#17666: 24.3.91; [regression] call-process in read-only buffers
Date: Mon, 02 Jun 2014 12:18:08 -0400
> evaluate the following with emacs -Q

> ;; running a process with no output via call-process
> ;; in any read-only buffer will do
> (with-temp-buffer
>   (let ((buffer-read-only t))
>     (call-process "true" nil t)))

> No problem with emacs 24.3

I do not remember this being changed consciously, but the change does
sound like a bug fix: you should bind inhibit-read-only if you want to
insert text into a read-only buffer, and call-process shouldn't be
an exception.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17666; Package emacs. (Mon, 02 Jun 2014 16:26:02 GMT) Full text and rfc822 format available.

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

From: "Roland Winkler" <winkler <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 17666 <at> debbugs.gnu.org
Subject: Re: bug#17666: 24.3.91; [regression] call-process in read-only buffers
Date: Mon, 2 Jun 2014 11:25:14 -0500
On Mon Jun 2 2014 Stefan Monnier wrote:
> > evaluate the following with emacs -Q
> 
> > ;; running a process with no output via call-process
> > ;; in any read-only buffer will do
> > (with-temp-buffer
> >   (let ((buffer-read-only t))
> >     (call-process "true" nil t)))
> 
> > No problem with emacs 24.3
> 
> I do not remember this being changed consciously, but the change does
> sound like a bug fix: you should bind inhibit-read-only if you want to
> insert text into a read-only buffer, and call-process shouldn't be
> an exception.

But what is the problem if a process does not have any output?
(Certainly, throwing an error makes sense for processes which do
create output in a read-only buffer.)

Roland




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17666; Package emacs. (Mon, 02 Jun 2014 17:38:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 17666 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#17666: 24.3.91; [regression] call-process in read-only buffers
Date: Mon, 02 Jun 2014 13:37:14 -0400
"Roland Winkler" wrote:

>> > (with-temp-buffer
>> >   (let ((buffer-read-only t))
>> >     (call-process "true" nil t)))
[...]
> But what is the problem if a process does not have any output?

If you know it isn't going to produce any output, why don't you just
discard the output instead of sending it to a read-only buffer (which is
something that really doesn't make sense)?

(with-temp-buffer
   (let ((buffer-read-only t))
     (call-process "true" nil nil)))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17666; Package emacs. (Mon, 02 Jun 2014 17:46:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 17666 <at> debbugs.gnu.org
Subject: Re: bug#17666: 24.3.91; [regression] call-process in read-only buffers
Date: Mon, 02 Jun 2014 13:45:25 -0400
Anyway, it's the prepare_to_modify_buffer in call_process what does it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17666; Package emacs. (Mon, 02 Jun 2014 17:58:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 17666 <at> debbugs.gnu.org
Subject: Re: bug#17666: 24.3.91; [regression] call-process in read-only buffers
Date: Mon, 02 Jun 2014 13:57:21 -0400
>> > evaluate the following with emacs -Q
>> > ;; running a process with no output via call-process
>> > ;; in any read-only buffer will do
>> > (with-temp-buffer
>> >   (let ((buffer-read-only t))
>> >     (call-process "true" nil t)))
>> > No problem with emacs 24.3
>> I do not remember this being changed consciously, but the change does
>> sound like a bug fix: you should bind inhibit-read-only if you want to
>> insert text into a read-only buffer, and call-process shouldn't be
>> an exception.
> But what is the problem if a process does not have any output?

Ah.. eh.. hmm.. yeah.. that case!
Well, then better make sure your process does output something!


        Stefan "who skipped the "true" part, obviously.  Sorry"




Reply sent to "Roland Winkler" <winkler <at> gnu.org>:
You have taken responsibility. (Mon, 02 Jun 2014 18:15:01 GMT) Full text and rfc822 format available.

Notification sent to "Roland Winkler" <winkler <at> gnu.org>:
bug acknowledged by developer. (Mon, 02 Jun 2014 18:15:02 GMT) Full text and rfc822 format available.

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

From: "Roland Winkler" <winkler <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 17666-done <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#17666: 24.3.91; [regression] call-process in read-only buffers
Date: Mon, 2 Jun 2014 13:14:15 -0500
On Mon Jun 2 2014 Glenn Morris wrote:
> If you know it isn't going to produce any output, why don't you
> just discard the output instead of sending it to a read-only
> buffer (which is something that really doesn't make sense)?

Certainly, there are various ways around this.

In my case, I cannot remember anymore in all detail why I wrote the
code the way I did.  I expect that I was really *expecting* to have
no output.  Also, in my case, the call of call-process is associated
with a buffer that is most often read-only. So using a read-only
buffer for the process output was probably my cheap solution to keep
track of "really no output".




Added tag(s) notabug and wontfix. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 02 Jun 2014 18:19:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17666; Package emacs. (Mon, 02 Jun 2014 18:36:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 17666 <at> debbugs.gnu.org, winkler <at> gnu.org
Subject: Re: bug#17666: 24.3.91; [regression] call-process in read-only buffers
Date: Mon, 02 Jun 2014 21:34:55 +0300
> Date: Mon, 02 Jun 2014 13:45:25 -0400
> Cc: 17666 <at> debbugs.gnu.org
> 
> Anyway, it's the prepare_to_modify_buffer in call_process what does it.

Actually, I think the problem is that the code there calls
decode_coding_c_string even if we read zero bytes from the process.
With some coding-systems, this will insert something into the buffer,
so the call to prepare_to_modify_buffer is justified.

But I agree that the previous behavior was sweeping a subtle bug under
the carpet.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#17666; Package emacs. (Mon, 02 Jun 2014 18:44:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Roland Winkler" <winkler <at> gnu.org>
Cc: 17666 <at> debbugs.gnu.org
Subject: Re: bug#17666: 24.3.91; [regression] call-process in read-only buffers
Date: Mon, 02 Jun 2014 14:42:50 -0400
>> evaluate the following with emacs -Q
>> ;; running a process with no output via call-process
>> ;; in any read-only buffer will do
>> (with-temp-buffer
>> (let ((buffer-read-only t))
>> (call-process "true" nil t)))
>> No problem with emacs 24.3

This should be fixed in emacs-24 now, thank you,


        Stefan




Removed tag(s) notabug and wontfix. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 02 Jun 2014 18:45:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 01 Jul 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 77 days ago.

Previous Next


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