]> code.delx.au - gnu-emacs/blobdiff - src/process.c
* pcomplete.el (pcomplete-comint-setup): Check for
[gnu-emacs] / src / process.c
index 3e06b4d5fdbf86fd3a4f5af11cdb0dc713a37cc9..058e20be03b4632fb9b1fa78441ab65407e06b9b 100644 (file)
@@ -467,10 +467,21 @@ status_message (p)
       synchronize_system_messages_locale ();
       signame = strsignal (code);
       if (signame == 0)
-       signame = "unknown";
-      string = build_string (signame);
+       string = build_string ("unknown");
+      else
+       {
+         int c1, c2;
+
+         string = make_unibyte_string (signame, strlen (signame));
+         if (! NILP (Vlocale_coding_system))
+           string = (code_convert_string_norecord
+                     (string, Vlocale_coding_system, 0));
+         c1 = STRING_CHAR ((char *) SDATA (string), 0);
+         c2 = DOWNCASE (c1);
+         if (c1 != c2)
+           Faset (string, make_number (0), make_number (c2));
+       }
       string2 = build_string (coredump ? " (core dumped)\n" : "\n");
-      SSET (string, 0, DOWNCASE (SREF (string, 0)));
       return concat2 (string, string2);
     }
   else if (EQ (symbol, Qexit))
@@ -1875,12 +1886,6 @@ create_process (process, new_argv, current_dir)
 #endif
       if (forkin < 0)
        report_file_error ("Opening pty", Qnil);
-#if defined (DONT_REOPEN_PTY)
-      /* In the case that vfork is defined as fork, the parent process
-        (Emacs) may send some data before the child process completes
-        tty options setup.  So we setup tty before forking.  */
-      child_setup_tty (forkout);
-#endif /* DONT_REOPEN_PTY */
 #else
       forkin = forkout = -1;
 #endif /* not USG, or USG_SUBTTY_WORKS */
@@ -2151,10 +2156,8 @@ create_process (process, new_argv, current_dir)
 #endif /* SIGCHLD */
 #endif /* !POSIX_SIGNALS */
 
-#if !defined (DONT_REOPEN_PTY)
        if (pty_flag)
          child_setup_tty (xforkout);
-#endif /* not DONT_REOPEN_PTY */
 #ifdef WINDOWSNT
        pid = child_setup (xforkin, xforkout, xforkout,
                           new_argv, 1, current_dir);
@@ -5193,7 +5196,6 @@ read_process_output (proc, channel)
   register int nbytes;
   char *chars;
   register Lisp_Object outstream;
-  register struct buffer *old = current_buffer;
   register struct Lisp_Process *p = XPROCESS (proc);
   register int opoint;
   struct coding_system *coding = proc_decode_coding_system[channel];
@@ -5393,9 +5395,11 @@ read_process_output (proc, channel)
       int opoint_byte;
       Lisp_Object text;
       struct buffer *b;
+      int count = SPECPDL_INDEX ();
 
       odeactivate = Vdeactivate_mark;
 
+      record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
       Fset_buffer (p->buffer);
       opoint = PT;
       opoint_byte = PT_BYTE;
@@ -5498,7 +5502,7 @@ read_process_output (proc, channel)
 
       current_buffer->read_only = old_read_only;
       SET_PT_BOTH (opoint, opoint_byte);
-      set_buffer_internal (old);
+      unbind_to (count, Qnil);
     }
   return nbytes;
 }
@@ -5628,7 +5632,8 @@ send_process (proc, buf, len, object)
        }
 
       len = coding->produced;
-      buf = SDATA (coding->dst_object);
+      object = coding->dst_object;
+      buf = SDATA (object);
     }
 
   if (pty_max_bytes == 0)
@@ -5759,9 +5764,7 @@ send_process (proc, buf, len, object)
 
                      /* Running filters might relocate buffers or strings.
                         Arrange to relocate BUF.  */
-                     if (CODING_REQUIRE_ENCODING (coding))
-                       offset = buf - SDATA (coding->dst_object);
-                     else if (BUFFERP (object))
+                     if (BUFFERP (object))
                        offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf);
                      else if (STRINGP (object))
                        offset = buf - SDATA (object);
@@ -5772,9 +5775,7 @@ send_process (proc, buf, len, object)
                      wait_reading_process_output (1, 0, 0, 0, Qnil, NULL, 0);
 #endif
 
-                     if (CODING_REQUIRE_ENCODING (coding))
-                       buf = offset + SDATA (coding->dst_object);
-                     else if (BUFFERP (object))
+                     if (BUFFERP (object))
                        buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset);
                      else if (STRINGP (object))
                        buf = offset + SDATA (object);