emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/process.c [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/process.c [emacs-unicode-2]
Date: Mon, 28 Jun 2004 03:55:31 -0400

Index: emacs/src/process.c
diff -c emacs/src/process.c:1.408.2.4 emacs/src/process.c:1.408.2.5
*** emacs/src/process.c:1.408.2.4       Thu May 13 12:52:29 2004
--- emacs/src/process.c Mon Jun 28 07:29:23 2004
***************
*** 445,454 ****
  
  /* Return a string describing a process status list.  */
  
! Lisp_Object
! status_message (status)
!      Lisp_Object status;
  {
    Lisp_Object symbol;
    int code, coredump;
    Lisp_Object string, string2;
--- 445,455 ----
  
  /* Return a string describing a process status list.  */
  
! static Lisp_Object
! status_message (p)
!      struct Lisp_Process *p;
  {
+   Lisp_Object status = p->status;
    Lisp_Object symbol;
    int code, coredump;
    Lisp_Object string, string2;
***************
*** 469,474 ****
--- 470,477 ----
      }
    else if (EQ (symbol, Qexit))
      {
+       if (NETCONN1_P (p))
+       return build_string (code == 0 ? "deleted\n" : "connection broken by 
remote peer\n");
        if (code == 0)
        return build_string ("finished\n");
        string = Fnumber_to_string (make_number (code));
***************
*** 532,538 ****
               three failures in a row before deciding that we've reached the
               end of the ptys.  */
            int failed_count = 0;
!           
            if (stat (pty_name, &stb) < 0)
              {
                failed_count++;
--- 535,541 ----
               three failures in a row before deciding that we've reached the
               end of the ptys.  */
            int failed_count = 0;
! 
            if (stat (pty_name, &stb) < 0)
              {
                failed_count++;
***************
*** 765,770 ****
--- 768,774 ----
      {
        XPROCESS (process)->status = Fcons (Qexit, Fcons (make_number (0), 
Qnil));
        XSETINT (XPROCESS (process)->tick, ++process_tick);
+       status_notify ();
      }
    else if (XINT (XPROCESS (process)->infd) >= 0)
      {
***************
*** 843,849 ****
  
  DEFUN ("process-id", Fprocess_id, Sprocess_id, 1, 1, 0,
         doc: /* Return the process id of PROCESS.
! This is the pid of the Unix process which PROCESS uses or talks to.
  For a network connection, this value is nil.  */)
       (process)
       register Lisp_Object process;
--- 847,853 ----
  
  DEFUN ("process-id", Fprocess_id, Sprocess_id, 1, 1, 0,
         doc: /* Return the process id of PROCESS.
! This is the pid of the external process which PROCESS uses or talks to.
  For a network connection, this value is nil.  */)
       (process)
       register Lisp_Object process;
***************
*** 1082,1088 ****
         Fset_process_query_on_exit_flag, Sset_process_query_on_exit_flag,
         2, 2, 0,
         doc: /* Specify if query is needed for PROCESS when Emacs is exited.
! If the second argument FLAG is non-nil, emacs will query the user before
  exiting if PROCESS is running.  */)
       (process, flag)
       register Lisp_Object process, flag;
--- 1086,1092 ----
         Fset_process_query_on_exit_flag, Sset_process_query_on_exit_flag,
         2, 2, 0,
         doc: /* Specify if query is needed for PROCESS when Emacs is exited.
! If the second argument FLAG is non-nil, Emacs will query the user before
  exiting if PROCESS is running.  */)
       (process, flag)
       register Lisp_Object process, flag;
***************
*** 1095,1101 ****
  DEFUN ("process-query-on-exit-flag",
         Fprocess_query_on_exit_flag, Sprocess_query_on_exit_flag,
         1, 1, 0,
!        doc: /* Return the current value of query on exit flag for PROCESS.  
*/)
       (process)
       register Lisp_Object process;
  {
--- 1099,1105 ----
  DEFUN ("process-query-on-exit-flag",
         Fprocess_query_on_exit_flag, Sprocess_query_on_exit_flag,
         1, 1, 0,
!        doc: /* Return the current value of query-on-exit flag for PROCESS.  
*/)
       (process)
       register Lisp_Object process;
  {
***************
*** 1458,1469 ****
  DEFUN ("start-process", Fstart_process, Sstart_process, 3, MANY, 0,
         doc: /* Start a program in a subprocess.  Return the process object 
for it.
  NAME is name for process.  It is modified if necessary to make it unique.
! BUFFER is the buffer or (buffer-name) to associate with the process.
   Process output goes at end of that buffer, unless you specify
   an output stream or filter function to handle the output.
   BUFFER may be also nil, meaning that this process is not associated
   with any buffer.
! Third arg is program file name.  It is searched for in PATH.
  Remaining arguments are strings to give program as arguments.
  
  usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS)  */)
--- 1462,1473 ----
  DEFUN ("start-process", Fstart_process, Sstart_process, 3, MANY, 0,
         doc: /* Start a program in a subprocess.  Return the process object 
for it.
  NAME is name for process.  It is modified if necessary to make it unique.
! BUFFER is the buffer (or buffer name) to associate with the process.
   Process output goes at end of that buffer, unless you specify
   an output stream or filter function to handle the output.
   BUFFER may be also nil, meaning that this process is not associated
   with any buffer.
! PROGRAM is the program file name.  It is searched for in PATH.
  Remaining arguments are strings to give program as arguments.
  
  usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS)  */)
***************
*** 2609,2615 ****
  a blocking connect (i.e. wait) for stream type connections.
  
  :noquery BOOL -- Query the user unless BOOL is non-nil, and process is
! running when emacs is exited.
  
  :stop BOOL -- Start process in the `stopped' state if BOOL non-nil.
  In the stopped state, a server process does not accept new
--- 2613,2619 ----
  a blocking connect (i.e. wait) for stream type connections.
  
  :noquery BOOL -- Query the user unless BOOL is non-nil, and process is
! running when Emacs is exited.
  
  :stop BOOL -- Start process in the `stopped' state if BOOL non-nil.
  In the stopped state, a server process does not accept new
***************
*** 2955,2961 ****
        struct hostent *host_info_ptr;
  
        /* gethostbyname may fail with TRY_AGAIN, but we don't honour that,
!        as it may `hang' emacs for a very long time.  */
        immediate_quit = 1;
        QUIT;
        host_info_ptr = gethostbyname (SDATA (host));
--- 2959,2965 ----
        struct hostent *host_info_ptr;
  
        /* gethostbyname may fail with TRY_AGAIN, but we don't honour that,
!        as it may `hang' Emacs for a very long time.  */
        immediate_quit = 1;
        QUIT;
        host_info_ptr = gethostbyname (SDATA (host));
***************
*** 3616,3621 ****
--- 3620,3627 ----
  #endif
  #endif        /* HAVE_SOCKETS */
  
+ /* Turn off input and output for process PROC.  */
+ 
  void
  deactivate_process (proc)
       Lisp_Object proc;
***************
*** 3635,3641 ****
        p->read_output_skip = Qnil;
      }
  #endif
!       
    if (inchannel >= 0)
      {
        /* Beware SIGCHLD hereabouts. */
--- 3641,3647 ----
        p->read_output_skip = Qnil;
      }
  #endif
! 
    if (inchannel >= 0)
      {
        /* Beware SIGCHLD hereabouts. */
***************
*** 3965,3971 ****
  
  /* This variable is different from waiting_for_input in keyboard.c.
     It is used to communicate to a lisp process-filter/sentinel (via the
!    function Fwaiting_for_user_input_p below) whether emacs was waiting
     for user-input when that process-filter was called.
     waiting_for_input cannot be used as that is by definition 0 when
     lisp code is being evalled.
--- 3971,3977 ----
  
  /* This variable is different from waiting_for_input in keyboard.c.
     It is used to communicate to a lisp process-filter/sentinel (via the
!    function Fwaiting_for_user_input_p below) whether Emacs was waiting
     for user-input when that process-filter was called.
     waiting_for_input cannot be used as that is by definition 0 when
     lisp code is being evalled.
***************
*** 4019,4026 ****
       int do_display;
  {
    register int channel, nfds;
!   static SELECT_TYPE Available;
!   static SELECT_TYPE Connecting;
    int check_connect, check_delay, no_avail;
    int xerrno;
    Lisp_Object proc;
--- 4025,4032 ----
       int do_display;
  {
    register int channel, nfds;
!   SELECT_TYPE Available;
!   SELECT_TYPE Connecting;
    int check_connect, check_delay, no_avail;
    int xerrno;
    Lisp_Object proc;
***************
*** 4031,4036 ****
--- 4037,4043 ----
    /* Either nil or a cons cell, the car of which is of interest and
       may be changed outside of this routine.  */
    Lisp_Object wait_for_cell = Qnil;
+   int saved_waiting_for_user_input_p = waiting_for_user_input_p;
  
    FD_ZERO (&Available);
    FD_ZERO (&Connecting);
***************
*** 4581,4587 ****
                }
            }
  #ifdef NON_BLOCKING_CONNECT
!         if (check_connect && FD_ISSET (channel, &Connecting))
            {
              struct Lisp_Process *p;
  
--- 4588,4595 ----
                }
            }
  #ifdef NON_BLOCKING_CONNECT
!         if (check_connect && FD_ISSET (channel, &Connecting)
!             && FD_ISSET (channel, &connect_wait_mask))
            {
              struct Lisp_Process *p;
  
***************
*** 4644,4650 ****
        }                       /* end for each file descriptor */
      }                         /* end while exit conditions not met */
  
!   waiting_for_user_input_p = 0;
  
    /* If calling from keyboard input, do not quit
       since we want to return C-g as an input character.
--- 4652,4658 ----
        }                       /* end for each file descriptor */
      }                         /* end while exit conditions not met */
  
!   waiting_for_user_input_p = saved_waiting_for_user_input_p;
  
    /* If calling from keyboard input, do not quit
       since we want to return C-g as an input character.
***************
*** 4691,4697 ****
     starting with our buffered-ahead character if we have one.
     Yield number of decoded characters read.
  
!    This function reads at most 1024 characters.
     If you want to read all available subprocess output,
     you must call it repeatedly until it returns zero.
  
--- 4699,4705 ----
     starting with our buffered-ahead character if we have one.
     Yield number of decoded characters read.
  
!    This function reads at most 4096 characters.
     If you want to read all available subprocess output,
     you must call it repeatedly until it returns zero.
  
***************
*** 4711,4717 ****
    register int opoint;
    struct coding_system *coding = proc_decode_coding_system[channel];
    int carryover = XINT (p->decoding_carryover);
!   int readmax = 1024;
  
  #ifdef VMS
    VMS_PROC_STUFF *vs, *get_vms_process_pointer();
--- 4719,4725 ----
    register int opoint;
    struct coding_system *coding = proc_decode_coding_system[channel];
    int carryover = XINT (p->decoding_carryover);
!   int readmax = 4096;
  
  #ifdef VMS
    VMS_PROC_STUFF *vs, *get_vms_process_pointer();
***************
*** 4744,4759 ****
      }
  #else /* not VMS */
  
- #ifdef DATAGRAM_SOCKETS
-   /* A datagram is one packet; allow at least 1500+ bytes of data
-      corresponding to the typical Ethernet frame size.  */
-   if (DATAGRAM_CHAN_P (channel))
-     {
-       /* carryover = 0; */  /* Does carryover make sense for datagrams? */
-       readmax += 1024;
-     }
- #endif
- 
    chars = (char *) alloca (carryover + readmax);
    if (carryover)
      /* See the comment above.  */
--- 4752,4757 ----
***************
*** 5069,5075 ****
  
  DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, 
Swaiting_for_user_input_p,
         0, 0, 0,
!        doc: /* Returns non-nil if emacs is waiting for input from the user.
  This is intended for use by asynchronous process output filters and 
sentinels.  */)
       ()
  {
--- 5067,5073 ----
  
  DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, 
Swaiting_for_user_input_p,
         0, 0, 0,
!        doc: /* Returns non-nil if Emacs is waiting for input from the user.
  This is intended for use by asynchronous process output filters and 
sentinels.  */)
       ()
  {
***************
*** 5446,5452 ****
  {
    int gid = -1;
  
! #ifdef TIOCGPGRP 
    if (ioctl (XINT (p->infd), TIOCGPGRP, &gid) == -1 && ! NILP (p->tty_name))
      {
        int fd;
--- 5444,5450 ----
  {
    int gid = -1;
  
! #ifdef TIOCGPGRP
    if (ioctl (XINT (p->infd), TIOCGPGRP, &gid) == -1 && ! NILP (p->tty_name))
      {
        int fd;
***************
*** 5643,5649 ****
         we should just assume that p->pid is also the process group id.  */
  
        gid = emacs_get_tty_pgrp (p);
!       
        if (gid == -1)
        /* If we can't get the information, assume
           the shell owns the tty.  */
--- 5641,5647 ----
         we should just assume that p->pid is also the process group id.  */
  
        gid = emacs_get_tty_pgrp (p);
! 
        if (gid == -1)
        /* If we can't get the information, assume
           the shell owns the tty.  */
***************
*** 5726,5732 ****
  DEFUN ("interrupt-process", Finterrupt_process, Sinterrupt_process, 0, 2, 0,
         doc: /* Interrupt process PROCESS.
  PROCESS may be a process, a buffer, or the name of a process or buffer.
! nil or no arg means current buffer's process.
  Second arg CURRENT-GROUP non-nil means send signal to
  the current process-group of the process's controlling terminal
  rather than to the process's own process group.
--- 5724,5730 ----
  DEFUN ("interrupt-process", Finterrupt_process, Sinterrupt_process, 0, 2, 0,
         doc: /* Interrupt process PROCESS.
  PROCESS may be a process, a buffer, or the name of a process or buffer.
! No arg or nil means current buffer's process.
  Second arg CURRENT-GROUP non-nil means send signal to
  the current process-group of the process's controlling terminal
  rather than to the process's own process group.
***************
*** 6385,6391 ****
          /* Get the text to use for the message.  */
          if (!NILP (p->raw_status_low))
            update_status (p);
!         msg = status_message (p->status);
  
          /* If process is terminated, deactivate it or delete it.  */
          symbol = p->status;
--- 6383,6389 ----
          /* Get the text to use for the message.  */
          if (!NILP (p->raw_status_low))
            update_status (p);
!         msg = status_message (p);
  
          /* If process is terminated, deactivate it or delete it.  */
          symbol = p->status;
***************
*** 6471,6483 ****
         doc: /* Set coding systems of PROCESS to DECODING and ENCODING.
  DECODING will be used to decode subprocess output and ENCODING to
  encode subprocess input.  */)
!      (proc, decoding, encoding)
!      register Lisp_Object proc, decoding, encoding;
  {
    register struct Lisp_Process *p;
  
!   CHECK_PROCESS (proc);
!   p = XPROCESS (proc);
    if (XINT (p->infd) < 0)
      error ("Input file descriptor of %s closed", SDATA (p->name));
    if (XINT (p->outfd) < 0)
--- 6469,6481 ----
         doc: /* Set coding systems of PROCESS to DECODING and ENCODING.
  DECODING will be used to decode subprocess output and ENCODING to
  encode subprocess input.  */)
!      (process, decoding, encoding)
!      register Lisp_Object process, decoding, encoding;
  {
    register struct Lisp_Process *p;
  
!   CHECK_PROCESS (process);
!   p = XPROCESS (process);
    if (XINT (p->infd) < 0)
      error ("Input file descriptor of %s closed", SDATA (p->name));
    if (XINT (p->outfd) < 0)
***************
*** 6487,6493 ****
  
    p->decode_coding_system = decoding;
    p->encode_coding_system = encoding;
!   setup_process_coding_systems (proc);
  
    return Qnil;
  }
--- 6485,6491 ----
  
    p->decode_coding_system = decoding;
    p->encode_coding_system = encoding;
!   setup_process_coding_systems (process);
  
    return Qnil;
  }
***************
*** 6495,6506 ****
  DEFUN ("process-coding-system",
         Fprocess_coding_system, Sprocess_coding_system, 1, 1, 0,
         doc: /* Return a cons of coding systems for decoding and encoding of 
PROCESS.  */)
!      (proc)
!      register Lisp_Object proc;
  {
!   CHECK_PROCESS (proc);
!   return Fcons (XPROCESS (proc)->decode_coding_system,
!               XPROCESS (proc)->encode_coding_system);
  }
  
  DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte,
--- 6493,6504 ----
  DEFUN ("process-coding-system",
         Fprocess_coding_system, Sprocess_coding_system, 1, 1, 0,
         doc: /* Return a cons of coding systems for decoding and encoding of 
PROCESS.  */)
!      (process)
!      register Lisp_Object process;
  {
!   CHECK_PROCESS (process);
!   return Fcons (XPROCESS (process)->decode_coding_system,
!               XPROCESS (process)->encode_coding_system);
  }
  
  DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte,
***************
*** 6510,6524 ****
  If FLAG is nil, the filter is given unibyte strings.  In this case,
  all character code conversion except for end-of-line conversion is
  suppressed.  */)
!      (proc, flag)
!      Lisp_Object proc, flag;
  {
    register struct Lisp_Process *p;
  
!   CHECK_PROCESS (proc);
!   p = XPROCESS (proc);
    p->filter_multibyte = flag;
!   setup_process_coding_systems (proc);
  
    return Qnil;
  }
--- 6508,6522 ----
  If FLAG is nil, the filter is given unibyte strings.  In this case,
  all character code conversion except for end-of-line conversion is
  suppressed.  */)
!      (process, flag)
!      Lisp_Object process, flag;
  {
    register struct Lisp_Process *p;
  
!   CHECK_PROCESS (process);
!   p = XPROCESS (process);
    p->filter_multibyte = flag;
!   setup_process_coding_systems (process);
  
    return Qnil;
  }
***************
*** 6526,6538 ****
  DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
         Sprocess_filter_multibyte_p, 1, 1, 0,
         doc: /* Return t if a multibyte string is given to PROCESS's filter.*/)
!      (proc)
!      Lisp_Object proc;
  {
    register struct Lisp_Process *p;
  
!   CHECK_PROCESS (proc);
!   p = XPROCESS (proc);
  
    return (NILP (p->filter_multibyte) ? Qnil : Qt);
  }
--- 6524,6536 ----
  DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
         Sprocess_filter_multibyte_p, 1, 1, 0,
         doc: /* Return t if a multibyte string is given to PROCESS's filter.*/)
!      (process)
!      Lisp_Object process;
  {
    register struct Lisp_Process *p;
  
!   CHECK_PROCESS (process);
!   p = XPROCESS (process);
  
    return (NILP (p->filter_multibyte) ? Qnil : Qt);
  }
***************
*** 6753,6763 ****
  #ifdef ADAPTIVE_READ_BUFFERING
    DEFVAR_LISP ("process-adaptive-read-buffering", 
&Vprocess_adaptive_read_buffering,
               doc: /* If non-nil, improve receive buffering by delaying after 
short reads.
! On some systems, when emacs reads the output from a subprocess, the output 
data
  is read in very small blocks, potentially resulting in very poor performance.
  This behaviour can be remedied to some extent by setting this variable to a
  non-nil value, as it will automatically delay reading from such processes, to
! allowing them to produce more output before emacs tries to read it.
  If the value is t, the delay is reset after each write to the process; any 
other
  non-nil value means that the delay is not reset on write.
  The variable takes effect when `start-process' is called.  */);
--- 6751,6761 ----
  #ifdef ADAPTIVE_READ_BUFFERING
    DEFVAR_LISP ("process-adaptive-read-buffering", 
&Vprocess_adaptive_read_buffering,
               doc: /* If non-nil, improve receive buffering by delaying after 
short reads.
! On some systems, when Emacs reads the output from a subprocess, the output 
data
  is read in very small blocks, potentially resulting in very poor performance.
  This behaviour can be remedied to some extent by setting this variable to a
  non-nil value, as it will automatically delay reading from such processes, to
! allowing them to produce more output before Emacs tries to read it.
  If the value is t, the delay is reset after each write to the process; any 
other
  non-nil value means that the delay is not reset on write.
  The variable takes effect when `start-process' is called.  */);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]