emacs-devel
[Top][All Lists]
Advanced

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

call-process and display-on-the-fly


From: Kim F. Storm
Subject: call-process and display-on-the-fly
Date: Tue, 12 Oct 2004 16:27:32 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

While debugging the "call-process" output buffering problem
I noticed that the display_on_the_fly flag is turned off
if the coding system cannot be determined immediately.

However, it seems bogus not to turn it back on when we actually
succeeds determining a coding system.

What about the following patch to remedy this?

Index: src/callproc.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/callproc.c,v
retrieving revision 1.203
diff -u -r1.203 callproc.c
--- src/callproc.c      29 Sep 2004 23:40:53 -0000      1.203
+++ src/callproc.c      12 Oct 2004 14:15:17 -0000
@@ -748,6 +748,7 @@
     int total_read = 0;
     int carryover = 0;
     int display_on_the_fly = !NILP (display) && INTERACTIVE;
+    int do_display = display_on_the_fly;
     struct coding_system saved_coding;
     int pt_orig = PT, pt_byte_orig = PT_BYTE;
     int inserted;
@@ -778,7 +779,7 @@
            nread += this_read;
            total_read += this_read;
 
-           if (display_on_the_fly)
+           if (do_display)
              break;
          }
 
@@ -817,7 +818,7 @@
                decode_coding (&process_coding, bufptr, decoding_buf,
                               nread, size);
 
-               if (display_on_the_fly
+               if (do_display
                    && saved_coding.type == coding_type_undecided
                    && process_coding.type != coding_type_undecided)
                  {
@@ -826,7 +827,7 @@
                       done by insufficient data.  So, we give up
                       displaying on the fly.  */
                    xfree (decoding_buf);
-                   display_on_the_fly = 0;
+                   do_display = 0;
                    process_coding = saved_coding;
                    carryover = nread;
                    continue;
@@ -929,12 +930,13 @@
            bufptr = tempptr;
          }
 
-       if (!NILP (display) && INTERACTIVE)
+       if (display_on_the_fly)
          {
            if (first)
              prepare_menu_bars ();
            first = 0;
            redisplay_preserve_echo_area (1);
+           do_display = 1;
          }
        immediate_quit = 1;
        QUIT;

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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