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

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

Re: inhibit-eol-conversion affects call-process marking buffers modified


From: Gerd Moellmann
Subject: Re: inhibit-eol-conversion affects call-process marking buffers modified
Date: 26 Oct 2001 12:30:50 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50

Erik Naggum <erik@naggum.net> writes:

> (let ((inhibit-eol-conversion t)
>       (buffer (generate-new-buffer "testing")))
>   (call-process "true" nil buffer nil)
>   (buffer-modified-p buffer))
> => t

(Fortunately, it wasn't as difficult to debug as I thought at first.)

The reason for buffer-modified-p returning t in the test case is that
call-process calls insert_1_both for 0 chars read (~line 780)

            if (! CODING_MAY_REQUIRE_DECODING (&process_coding))
              insert_1_both (bufptr, nread, nread, 0, 1, 0);

and insert_1_both always increments the buffer modified counter.

One possible solution is to make insert_1_both simply return when
NCHARS == 0.

Kenichi, could you please check this?  Are there cases where
insert_1_both may be called intentionally with NCHARS == 0, maybe
for the side effect of moving the gap?

*** insdel.c    2001/10/26 10:22:01     1.158
--- insdel.c    2001/10/26 10:22:12
***************
*** 913,918 ****
--- 913,921 ----
       register int nchars, nbytes;
       int inherit, prepare, before_markers;
  {
+   if (nchars == 0)
+     return;
+   
    if (NILP (current_buffer->enable_multibyte_characters))
      nchars = nbytes;
  




reply via email to

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