all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* call-process and display-on-the-fly
@ 2004-10-12 14:27 Kim F. Storm
  2004-10-13  0:44 ` Kenichi Handa
  0 siblings, 1 reply; 4+ messages in thread
From: Kim F. Storm @ 2004-10-12 14:27 UTC (permalink / raw)



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 <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-13 11:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-12 14:27 call-process and display-on-the-fly Kim F. Storm
2004-10-13  0:44 ` Kenichi Handa
2004-10-13  9:16   ` Kim F. Storm
2004-10-13 11:32     ` Kenichi Handa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.