diff options
Diffstat (limited to 'src/callproc.c')
| -rw-r--r-- | src/callproc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/callproc.c b/src/callproc.c index 7632d491944..d9f9a342575 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) |
| @@ -739,7 +740,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 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; |
| @@ -803,6 +804,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 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 | ||
| @@ -832,12 +836,16 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 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; |