(Fminibuffer_complete): Add third arg to Fset_window_start.
[bpt/emacs.git] / src / vmsproc.c
index ec9678f..f6e29f4 100644 (file)
@@ -26,11 +26,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
     23 is the timer event flag
     24-31 are reserved by VMS
 */
+#include <config.h>
 #include       <ssdef.h>
 #include       <iodef.h>
 #include       <dvidef.h>
 #include       <clidef.h>
 #include       "vmsproc.h"
+#include       "lisp.h"
+#include       "buffer.h"
+#include       <file.h>
+#include       "process.h"
+#include       "commands.h"
+#include       <errno.h>
+extern Lisp_Object call_process_cleanup ();
+
 
 #define                KEYBOARD_EVENT_FLAG             1
 #define                TIMER_EVENT_FLAG                23
@@ -241,7 +250,7 @@ write_to_vms_process (vs, buf, len)
          error ("Could not write to subprocess: %x", status);
          return (0);
        }
-      len =- out;
+      len -= out;
     }
   return (1);
 }
@@ -437,7 +446,7 @@ if you quit, the process is killed.")
 
   CHECK_STRING (args[0], 0);
 
-  if (nargs <= 1 || NULL (args[1]))
+  if (nargs <= 1 || NILP (args[1]))
     args[1] = build_string ("NLA0:");
   else
     args[1] = Fexpand_file_name (args[1], current_buffer->directory);
@@ -573,6 +582,9 @@ if you quit, the process is killed.")
       return Qnil;
     }
 
+  if (!NILP (display) && INTERACTIVE)
+    prepare_menu_bars ();
+
   record_unwind_protect (call_process_cleanup,
                         Fcons (make_number (fd[0]), make_number (pid)));
 
@@ -589,12 +601,12 @@ if you quit, the process is killed.")
       if (vs->iosb[0] & 1)
        {
          immediate_quit = 0;
-         if (!NULL (buffer))
+         if (!NILP (buffer))
            {
              vs->iosb[1] = clean_vms_buffer (vs->inputBuffer, vs->iosb[1]);
              InsCStr (vs->inputBuffer, vs->iosb[1]);
            }
-         if (!NULL (display) && INTERACTIVE)
+         if (!NILP (display) && INTERACTIVE)
          redisplay_preserve_echo_area ();
          immediate_quit = 1;
          QUIT;
@@ -604,9 +616,10 @@ if you quit, the process is killed.")
       else
        break;
     }
-    sys$dassgn (inchannel);
-    sys$dassgn (outchannel);
-    give_back_vms_process_stuff (vs);
+
+  sys$dassgn (inchannel);
+  sys$dassgn (outchannel);
+  give_back_vms_process_stuff (vs);
 
   /* Wait for it to terminate, unless it already has.  */
   wait_for_termination (pid);
@@ -715,7 +728,7 @@ create_process (process, new_argv)
   chan_process[inchannel] = process;
   XFASTINT (XPROCESS (process)->infd) = inchannel;
   XFASTINT (XPROCESS (process)->outfd) = outchannel;
-  XFASTINT (XPROCESS (process)->flags) = RUNNING;
+  XPROCESS (process)->status = Qrun
 
   /* Delay interrupts until we have a chance to store
      the new fork's pid in its process structure */
@@ -755,10 +768,7 @@ child_sig (vs)
   if (XSYMBOL (tail) == XSYMBOL (Qnil))
     return;
 
-  child_changed++;
-  XFASTINT (p->flags) = EXITED | CHANGED;
-  /* Truncate the exit status to 24 bits so that it fits in a FASTINT */
-  XFASTINT (p->reason) = (vs->exitStatus) & 0xffffff;
+  p->status = Fcons (Qexit, Fcons (make_number (vs->exitStatus), Qnil))
 }
 
 syms_of_vmsproc ()