216 |
int nargs; |
int nargs; |
217 |
register Lisp_Object *args; |
register Lisp_Object *args; |
218 |
{ |
{ |
219 |
Lisp_Object infile, buffer, current_dir, display, path; |
Lisp_Object infile, buffer, current_dir, path; |
220 |
|
int display_p; |
221 |
int fd[2]; |
int fd[2]; |
222 |
int filefd; |
int filefd; |
223 |
register int pid; |
register int pid; |
373 |
UNGCPRO; |
UNGCPRO; |
374 |
} |
} |
375 |
|
|
376 |
display = nargs >= 4 ? args[3] : Qnil; |
display_p = INTERACTIVE && nargs >= 4 && !NILP (args[3]); |
377 |
|
|
378 |
filefd = emacs_open (SDATA (infile), O_RDONLY, 0); |
filefd = emacs_open (SDATA (infile), O_RDONLY, 0); |
379 |
if (filefd < 0) |
if (filefd < 0) |
748 |
int first = 1; |
int first = 1; |
749 |
int total_read = 0; |
int total_read = 0; |
750 |
int carryover = 0; |
int carryover = 0; |
751 |
int display_on_the_fly = !NILP (display) && INTERACTIVE; |
int display_on_the_fly = display_p; |
752 |
struct coding_system saved_coding; |
struct coding_system saved_coding; |
753 |
int pt_orig = PT, pt_byte_orig = PT_BYTE; |
int pt_orig = PT, pt_byte_orig = PT_BYTE; |
754 |
int inserted; |
int inserted; |
824 |
{ |
{ |
825 |
/* We have detected some coding system. But, |
/* We have detected some coding system. But, |
826 |
there's a possibility that the detection was |
there's a possibility that the detection was |
827 |
done by insufficient data. So, we give up |
done by insufficient data. So, we try the code |
828 |
displaying on the fly. */ |
detection again with more data. */ |
829 |
xfree (decoding_buf); |
xfree (decoding_buf); |
830 |
display_on_the_fly = 0; |
display_on_the_fly = 0; |
831 |
process_coding = saved_coding; |
process_coding = saved_coding; |
832 |
carryover = nread; |
carryover = nread; |
833 |
|
/* This is to make the above condition always |
834 |
|
fails in the future. */ |
835 |
|
saved_coding.type = coding_type_no_conversion; |
836 |
continue; |
continue; |
837 |
} |
} |
838 |
|
|
933 |
bufptr = tempptr; |
bufptr = tempptr; |
934 |
} |
} |
935 |
|
|
936 |
if (!NILP (display) && INTERACTIVE) |
if (display_p) |
937 |
{ |
{ |
938 |
if (first) |
if (first) |
939 |
prepare_menu_bars (); |
prepare_menu_bars (); |
940 |
first = 0; |
first = 0; |
941 |
redisplay_preserve_echo_area (1); |
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; |
946 |
} |
} |
947 |
immediate_quit = 1; |
immediate_quit = 1; |
948 |
QUIT; |
QUIT; |