/[emacs]/emacs/src/callproc.c
ViewVC logotype

Diff of /emacs/src/callproc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.203 by handa, Wed Sep 29 23:40:53 2004 UTC revision 1.204 by kfstorm, Wed Oct 13 09:50:36 2004 UTC
# Line 216  usage: (call-process PROGRAM &optional I Line 216  usage: (call-process PROGRAM &optional I
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;
# Line 372  usage: (call-process PROGRAM &optional I Line 373  usage: (call-process PROGRAM &optional I
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)
# Line 747  usage: (call-process PROGRAM &optional I Line 748  usage: (call-process PROGRAM &optional I
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;
# Line 823  usage: (call-process PROGRAM &optional I Line 824  usage: (call-process PROGRAM &optional I
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    
# Line 929  usage: (call-process PROGRAM &optional I Line 933  usage: (call-process PROGRAM &optional I
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;

Legend:
Removed from v.1.203  
changed lines
  Added in v.1.204

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26