aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-10-13 09:50:36 +0000
committerKim F. Storm2004-10-13 09:50:36 +0000
commit0aa2630fac731241c383caa14eec3df5f93d6d94 (patch)
tree9ec92c1a9a0f6149555488c7d3ce5be46878f3a5 /src
parent7cfdabde5fa5a9df23dbc391bde79f70c137db1c (diff)
downloademacs-0aa2630fac731241c383caa14eec3df5f93d6d94.tar.gz
emacs-0aa2630fac731241c383caa14eec3df5f93d6d94.zip
(Fcall_process): Simplify handling of display arg.
Resume `display_on_the_fly' once a coding system is determined.
Diffstat (limited to 'src')
-rw-r--r--src/callproc.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/callproc.c b/src/callproc.c
index effd7ecbb14..5d7447d94f2 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -216,7 +216,8 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest 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;
@@ -372,7 +373,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
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)
@@ -747,7 +748,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
747 int first = 1; 748 int first = 1;
748 int total_read = 0; 749 int total_read = 0;
749 int carryover = 0; 750 int carryover = 0;
750 int display_on_the_fly = !NILP (display) && INTERACTIVE; 751 int display_on_the_fly = display_p;
751 struct coding_system saved_coding; 752 struct coding_system saved_coding;
752 int pt_orig = PT, pt_byte_orig = PT_BYTE; 753 int pt_orig = PT, pt_byte_orig = PT_BYTE;
753 int inserted; 754 int inserted;
@@ -823,12 +824,15 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
823 { 824 {
824 /* We have detected some coding system. But, 825 /* We have detected some coding system. But,
825 there's a possibility that the detection was 826 there's a possibility that the detection was
826 done by insufficient data. So, we give up 827 done by insufficient data. So, we try the code
827 displaying on the fly. */ 828 detection again with more data. */
828 xfree (decoding_buf); 829 xfree (decoding_buf);
829 display_on_the_fly = 0; 830 display_on_the_fly = 0;
830 process_coding = saved_coding; 831 process_coding = saved_coding;
831 carryover = nread; 832 carryover = nread;
833 /* This is to make the above condition always
834 fails in the future. */
835 saved_coding.type = coding_type_no_conversion;
832 continue; 836 continue;
833 } 837 }
834 838
@@ -929,12 +933,16 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
929 bufptr = tempptr; 933 bufptr = tempptr;
930 } 934 }
931 935
932 if (!NILP (display) && INTERACTIVE) 936 if (display_p)
933 { 937 {
934 if (first) 938 if (first)
935 prepare_menu_bars (); 939 prepare_menu_bars ();
936 first = 0; 940 first = 0;
937 redisplay_preserve_echo_area (1); 941 redisplay_preserve_echo_area (1);
942 /* This variable might have been set to 0 for code
943 detection. In that case, we set it back to 1 because
944 we should have already detected a coding system. */
945 display_on_the_fly = 1;
938 } 946 }
939 immediate_quit = 1; 947 immediate_quit = 1;
940 QUIT; 948 QUIT;