]> code.delx.au - gnu-emacs/blobdiff - src/callproc.c
Merge from emacs--devo--0
[gnu-emacs] / src / callproc.c
index 54ebf53979e875f3c08158000dd525c45fb4f3cd..d8eebac08a63ae3f1b710030545530cb29e4c231 100644 (file)
@@ -203,6 +203,10 @@ t (mix it with ordinary output), or a file name string.
 Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted.
 Remaining arguments are strings passed as command arguments to PROGRAM.
 
+If executable PROGRAM can't be found as an executable, `call-process'
+signals a Lisp error.  `call-process' reports errors in execution of
+the program only through its return and output.
+
 If BUFFER is 0, `call-process' returns immediately with value nil.
 Otherwise it waits for PROGRAM to terminate
 and returns a numeric exit status or a signal description string.
@@ -269,6 +273,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
     if (nargs >= 5)
       {
        int must_encode = 0;
+       Lisp_Object coding_attrs;
 
        for (i = 4; i < nargs; i++)
          CHECK_STRING (args[i]);
@@ -294,7 +299,15 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
            else
              val = Qnil;
          }
+       val = coding_inherit_eol_type (val, Qnil);
        setup_coding_system (Fcheck_coding_system (val), &argument_coding);
+       coding_attrs = CODING_ID_ATTRS (argument_coding.id);
+       if (NILP (CODING_ATTR_ASCII_COMPAT (coding_attrs)))
+         {
+           /* We should not use an ASCII incompatible coding system.  */
+           val = raw_text_coding_system (val);
+           setup_coding_system (val, &argument_coding);
+         }
       }
   }