comparison src/callproc.c @ 90016:ff0e824afa37

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-57 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-594 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-598 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-599 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-600 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-602 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-603 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-604 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-609 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-611 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-614 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-615 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-42 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-43 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-44 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-46 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-47 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-48 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-49 Add {arch}/=commit-merge-make-log * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-50 {arch}/=commit-merge-make-log: Don't die if there are no ChangeLog changes
author Miles Bader <miles@gnu.org>
date Thu, 14 Oct 2004 08:50:09 +0000
parents 4c90ffeb71c5 fb60234070b0
children 6e012bc03071
comparison
equal deleted inserted replaced
90015:9ee566735998 90016:ff0e824afa37
214 usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) 214 usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
215 (nargs, args) 215 (nargs, args)
216 int nargs; 216 int nargs;
217 register Lisp_Object *args; 217 register Lisp_Object *args;
218 { 218 {
219 Lisp_Object infile, buffer, current_dir, display, path; 219 Lisp_Object infile, buffer, current_dir, path;
220 int display_p;
220 int fd[2]; 221 int fd[2];
221 int filefd; 222 int filefd;
222 register int pid; 223 register int pid;
223 char buf[16384]; 224 char buf[16384];
224 char *bufptr = buf; 225 char *bufptr = buf;
370 Fcons (current_buffer->directory, Qnil)); 371 Fcons (current_buffer->directory, Qnil));
371 372
372 UNGCPRO; 373 UNGCPRO;
373 } 374 }
374 375
375 display = nargs >= 4 ? args[3] : Qnil; 376 display_p = INTERACTIVE && nargs >= 4 && !NILP (args[3]);
376 377
377 filefd = emacs_open (SDATA (infile), O_RDONLY, 0); 378 filefd = emacs_open (SDATA (infile), O_RDONLY, 0);
378 if (filefd < 0) 379 if (filefd < 0)
379 { 380 {
380 report_file_error ("Opening process input file", Fcons (infile, Qnil)); 381 report_file_error ("Opening process input file", Fcons (infile, Qnil));
737 { 738 {
738 register int nread; 739 register int nread;
739 int first = 1; 740 int first = 1;
740 int total_read = 0; 741 int total_read = 0;
741 int carryover = 0; 742 int carryover = 0;
742 int display_on_the_fly = !NILP (display) && INTERACTIVE; 743 int display_on_the_fly = display_p;
743 struct coding_system saved_coding; 744 struct coding_system saved_coding;
744 745
745 saved_coding = process_coding; 746 saved_coding = process_coding;
746 while (1) 747 while (1)
747 { 748 {
801 process_coding.dst_pos_byte 802 process_coding.dst_pos_byte
802 + process_coding.produced, 0); 803 + process_coding.produced, 0);
803 display_on_the_fly = 0; 804 display_on_the_fly = 0;
804 process_coding = saved_coding; 805 process_coding = saved_coding;
805 carryover = nread; 806 carryover = nread;
807 /* This is to make the above condition always
808 fails in the future. */
809 saved_coding.type = coding_type_no_conversion;
806 continue; 810 continue;
807 } 811 }
808 812
809 TEMP_SET_PT_BOTH (PT + process_coding.produced_char, 813 TEMP_SET_PT_BOTH (PT + process_coding.produced_char,
810 PT_BYTE + process_coding.produced); 814 PT_BYTE + process_coding.produced);
830 tempptr = (char *) alloca (bufsize); 834 tempptr = (char *) alloca (bufsize);
831 bcopy (bufptr, tempptr, bufsize / 2); 835 bcopy (bufptr, tempptr, bufsize / 2);
832 bufptr = tempptr; 836 bufptr = tempptr;
833 } 837 }
834 838
835 if (!NILP (display) && INTERACTIVE) 839 if (display_p)
836 { 840 {
837 if (first) 841 if (first)
838 prepare_menu_bars (); 842 prepare_menu_bars ();
839 first = 0; 843 first = 0;
840 redisplay_preserve_echo_area (1); 844 redisplay_preserve_echo_area (1);
845 /* This variable might have been set to 0 for code
846 detection. In that case, we set it back to 1 because
847 we should have already detected a coding system. */
848 display_on_the_fly = 1;
841 } 849 }
842 immediate_quit = 1; 850 immediate_quit = 1;
843 QUIT; 851 QUIT;
844 } 852 }
845 give_up: ; 853 give_up: ;