1 /* Synchronous subprocess invocation for GNU Emacs.
2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
28 extern char *strerror ();
30 /* Define SIGCHLD as an alias for SIGCLD. */
32 #if !defined (SIGCHLD) && defined (SIGCLD)
33 #define SIGCHLD SIGCLD
36 #include <sys/types.h>
40 #define INCLUDED_FCNTL
44 #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
46 #define INCLUDED_FCNTL
49 #include <sys/param.h>
66 #include "syssignal.h"
70 extern noshare
char **environ
;
72 extern char **environ
;
75 #define max(a, b) ((a) > (b) ? (a) : (b))
78 /* When we are starting external processes we need to know whether they
79 take binary input (no conversion) or text input (\n is converted to
80 \r\n). Similar for output: if newlines are written as \r\n then it's
81 text process output, otherwise it's binary. */
82 Lisp_Object Vbinary_process_input
;
83 Lisp_Object Vbinary_process_output
;
86 Lisp_Object Vexec_path
, Vexec_directory
, Vdata_directory
, Vdoc_directory
;
87 Lisp_Object Vconfigure_info_directory
;
89 Lisp_Object Vshell_file_name
;
91 Lisp_Object Vprocess_environment
;
94 Lisp_Object Qbuffer_file_type
;
97 /* True iff we are about to fork off a synchronous process or if we
98 are waiting for it. */
99 int synch_process_alive
;
101 /* Nonzero => this is a string explaining death of synchronous subprocess. */
102 char *synch_process_death
;
104 /* If synch_process_death is zero,
105 this is exit code of synchronous subprocess. */
106 int synch_process_retcode
;
108 extern Lisp_Object Vdoc_file_name
;
110 /* Clean up when exiting Fcall_process.
111 On MSDOS, delete the temporary file on any kind of termination.
112 On Unix, kill the process and any children on termination by signal. */
114 /* Nonzero if this is termination due to exit. */
115 static int call_process_exited
;
117 #ifndef VMS /* VMS version is in vmsproc.c. */
120 call_process_kill (fdpid
)
123 close (XFASTINT (Fcar (fdpid
)));
124 EMACS_KILLPG (XFASTINT (Fcdr (fdpid
)), SIGKILL
);
125 synch_process_alive
= 0;
130 call_process_cleanup (fdpid
)
134 /* for MSDOS fdpid is really (fd . tempfile) */
135 register Lisp_Object file
;
137 close (XFASTINT (Fcar (fdpid
)));
138 if (strcmp (XSTRING (file
)-> data
, NULL_DEVICE
) != 0)
139 unlink (XSTRING (file
)->data
);
140 #else /* not MSDOS */
141 register int pid
= XFASTINT (Fcdr (fdpid
));
144 if (call_process_exited
)
146 close (XFASTINT (Fcar (fdpid
)));
150 if (EMACS_KILLPG (pid
, SIGINT
) == 0)
152 int count
= specpdl_ptr
- specpdl
;
153 record_unwind_protect (call_process_kill
, fdpid
);
154 message1 ("Waiting for process to die...(type C-g again to kill it instantly)");
157 wait_for_termination (pid
);
159 specpdl_ptr
= specpdl
+ count
; /* Discard the unwind protect. */
160 message1 ("Waiting for process to die...done");
162 synch_process_alive
= 0;
163 close (XFASTINT (Fcar (fdpid
)));
164 #endif /* not MSDOS */
168 DEFUN ("call-process", Fcall_process
, Scall_process
, 1, MANY
, 0,
169 "Call PROGRAM synchronously in separate process.\n\
170 The program's input comes from file INFILE (nil means `/dev/null').\n\
171 Insert output in BUFFER before point; t means current buffer;\n\
172 nil for BUFFER means discard it; 0 means discard and don't wait.\n\
173 Fourth arg DISPLAY non-nil means redisplay buffer as output is inserted.\n\
174 Remaining arguments are strings passed as command arguments to PROGRAM.\n\
175 If BUFFER is 0, returns immediately with value nil.\n\
176 Otherwise waits for PROGRAM to terminate\n\
177 and returns a numeric exit status or a signal description string.\n\
178 If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
181 register Lisp_Object
*args
;
183 Lisp_Object infile
, buffer
, current_dir
, display
, path
;
188 int count
= specpdl_ptr
- specpdl
;
189 register unsigned char **new_argv
190 = (unsigned char **) alloca ((max (2, nargs
- 2)) * sizeof (char *));
191 struct buffer
*old
= current_buffer
;
192 #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
193 char *outf
, *tempfile
;
199 CHECK_STRING (args
[0], 0);
202 /* Without asynchronous processes we cannot have BUFFER == 0. */
203 if (nargs
>= 3 && INTEGERP (args
[2]))
204 error ("Operating system cannot handle asynchronous subprocesses");
205 #endif /* subprocesses */
207 if (nargs
>= 2 && ! NILP (args
[1]))
209 infile
= Fexpand_file_name (args
[1], current_buffer
->directory
);
210 CHECK_STRING (infile
, 1);
213 infile
= build_string (NULL_DEVICE
);
217 register Lisp_Object tem
;
219 buffer
= tem
= args
[2];
222 || XFASTINT (tem
) == 0))
224 buffer
= Fget_buffer (tem
);
225 CHECK_BUFFER (buffer
, 2);
231 /* Make sure that the child will be able to chdir to the current
232 buffer's current directory, or its unhandled equivalent. We
233 can't just have the child check for an error when it does the
234 chdir, since it's in a vfork.
236 We have to GCPRO around this because Fexpand_file_name,
237 Funhandled_file_name_directory, and Ffile_accessible_directory_p
238 might call a file name handling function. The argument list is
239 protected by the caller, so all we really have to worry about is
242 struct gcpro gcpro1
, gcpro2
, gcpro3
;
244 current_dir
= current_buffer
->directory
;
246 GCPRO3 (infile
, buffer
, current_dir
);
249 = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir
),
251 if (NILP (Ffile_accessible_directory_p (current_dir
)))
252 report_file_error ("Setting current directory",
253 Fcons (current_buffer
->directory
, Qnil
));
258 display
= nargs
>= 4 ? args
[3] : Qnil
;
260 filefd
= open (XSTRING (infile
)->data
, O_RDONLY
, 0);
263 report_file_error ("Opening process input file", Fcons (infile
, Qnil
));
265 /* Search for program; barf if not found. */
269 GCPRO1 (current_dir
);
270 openp (Vexec_path
, args
[0], EXEC_SUFFIXES
, &path
, 1);
276 report_file_error ("Searching for program", Fcons (args
[0], Qnil
));
278 new_argv
[0] = XSTRING (path
)->data
;
281 for (i
= 4; i
< nargs
; i
++)
283 CHECK_STRING (args
[i
], i
);
284 new_argv
[i
- 3] = XSTRING (args
[i
])->data
;
289 #ifdef MSDOS /* MW, July 1993 */
290 /* These vars record information from process termination.
291 Clear them now before process can possibly terminate,
292 to avoid timing error if process terminates soon. */
293 synch_process_death
= 0;
294 synch_process_retcode
= 0;
296 if ((outf
= egetenv ("TMP")) || (outf
= egetenv ("TEMP")))
297 strcpy (tempfile
= alloca (strlen (outf
) + 20), outf
);
300 tempfile
= alloca (20);
303 dostounix_filename (tempfile
);
304 if (*tempfile
== '\0' || tempfile
[strlen (tempfile
) - 1] != '/')
305 strcat (tempfile
, "/");
306 strcat (tempfile
, "detmp.XXX");
309 outfilefd
= creat (tempfile
, S_IREAD
| S_IWRITE
);
313 report_file_error ("Opening process output file", Fcons (tempfile
, Qnil
));
317 if (INTEGERP (buffer
))
318 fd
[1] = open (NULL_DEVICE
, O_WRONLY
), fd
[0] = -1;
325 /* Replaced by close_process_descs */
326 set_exclusive_use (fd
[0]);
331 /* child_setup must clobber environ in systems with true vfork.
332 Protect it from permanent change. */
333 register char **save_environ
= environ
;
334 register int fd1
= fd
[1];
336 #if 0 /* Some systems don't have sigblock. */
337 mask
= sigblock (sigmask (SIGCHLD
));
340 /* Record that we're about to create a synchronous process. */
341 synch_process_alive
= 1;
343 /* These vars record information from process termination.
344 Clear them now before process can possibly terminate,
345 to avoid timing error if process terminates soon. */
346 synch_process_death
= 0;
347 synch_process_retcode
= 0;
349 #ifdef MSDOS /* MW, July 1993 */
350 /* ??? Someone who knows MSDOG needs to check whether this properly
351 closes all descriptors that it opens. */
352 pid
= run_msdos_command (new_argv
, current_dir
, filefd
, outfilefd
);
354 fd1
= -1; /* No harm in closing that one! */
355 fd
[0] = open (tempfile
, NILP (Vbinary_process_output
) ? O_TEXT
: O_BINARY
);
360 report_file_error ("Cannot re-open temporary file", Qnil
);
362 #else /* not MSDOS */
374 child_setup (filefd
, fd1
, fd1
, new_argv
, 0, current_dir
);
376 #endif /* not MSDOS */
378 environ
= save_environ
;
380 /* Close most of our fd's, but not fd[0]
381 since we will use that to read input from. */
391 report_file_error ("Doing vfork", Qnil
);
394 if (INTEGERP (buffer
))
399 /* If Emacs has been built with asynchronous subprocess support,
400 we don't need to do this, I think because it will then have
401 the facilities for handling SIGCHLD. */
402 wait_without_blocking ();
403 #endif /* subprocesses */
407 /* Enable sending signal if user quits below. */
408 call_process_exited
= 0;
411 /* MSDOS needs different cleanup information. */
412 record_unwind_protect (call_process_cleanup
,
413 Fcons (make_number (fd
[0]), build_string (tempfile
)));
415 record_unwind_protect (call_process_cleanup
,
416 Fcons (make_number (fd
[0]), make_number (pid
)));
417 #endif /* not MSDOS */
420 if (BUFFERP (buffer
))
421 Fset_buffer (buffer
);
430 while ((nread
= read (fd
[0], buf
, sizeof buf
)) != 0)
434 #if defined (__osf__) && defined (__alpha)
435 continue; /* Work around bug in DEC OSF/1 V3.0. */
443 if (!NILP (display
) && INTERACTIVE
)
446 prepare_menu_bars ();
448 redisplay_preserve_echo_area ();
455 /* Wait for it to terminate, unless it already has. */
456 wait_for_termination (pid
);
460 set_buffer_internal (old
);
462 /* Don't kill any children that the subprocess may have left behind
464 call_process_exited
= 1;
466 unbind_to (count
, Qnil
);
468 if (synch_process_death
)
469 return build_string (synch_process_death
);
470 return make_number (synch_process_retcode
);
475 delete_temp_file (name
)
478 /* Use Fdelete_file because that runs a file name handler.
479 We did that when writing the file, so we should do so when deleting. */
483 DEFUN ("call-process-region", Fcall_process_region
, Scall_process_region
,
485 "Send text from START to END to a synchronous process running PROGRAM.\n\
486 Delete the text if fourth arg DELETE is non-nil.\n\
487 Insert output in BUFFER before point; t means current buffer;\n\
488 nil for BUFFER means discard it; 0 means discard and don't wait.\n\
489 Sixth arg DISPLAY non-nil means redisplay buffer as output is inserted.\n\
490 Remaining args are passed to PROGRAM at startup as command args.\n\
491 If BUFFER is nil, returns immediately with value nil.\n\
492 Otherwise waits for PROGRAM to terminate\n\
493 and returns a numeric exit status or a signal description string.\n\
494 If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.")
497 register Lisp_Object
*args
;
500 Lisp_Object filename_string
;
501 register Lisp_Object start
, end
;
507 int count
= specpdl_ptr
- specpdl
;
511 if ((outf
= egetenv ("TMP")) || (outf
= egetenv ("TEMP")))
512 strcpy (tempfile
= alloca (strlen (outf
) + 20), outf
);
515 tempfile
= alloca (20);
518 dostounix_filename (tempfile
);
519 if (tempfile
[strlen (tempfile
) - 1] != '/')
520 strcat (tempfile
, "/");
521 strcat (tempfile
, "detmp.XXX");
522 #else /* not MSDOS */
525 strcpy (tempfile
, "tmp:emacsXXXXXX.");
527 strcpy (tempfile
, "/tmp/emacsXXXXXX");
529 #endif /* not MSDOS */
533 filename_string
= build_string (tempfile
);
534 GCPRO1 (filename_string
);
538 specbind (Qbuffer_file_type
, Vbinary_process_input
);
539 Fwrite_region (start
, end
, filename_string
, Qnil
, Qlambda
);
540 unbind_to (count
, Qnil
);
542 Fwrite_region (start
, end
, filename_string
, Qnil
, Qlambda
);
545 record_unwind_protect (delete_temp_file
, filename_string
);
548 Fdelete_region (start
, end
);
550 args
[3] = filename_string
;
552 RETURN_UNGCPRO (unbind_to (count
, Fcall_process (nargs
- 2, args
+ 2)));
555 #ifndef VMS /* VMS version is in vmsproc.c. */
557 /* This is the last thing run in a newly forked inferior
558 either synchronous or asynchronous.
559 Copy descriptors IN, OUT and ERR as descriptors 0, 1 and 2.
560 Initialize inferior's priority, pgrp, connected dir and environment.
561 then exec another program based on new_argv.
563 This function may change environ for the superior process.
564 Therefore, the superior process must save and restore the value
565 of environ around the vfork and the call to this function.
567 ENV is the environment for the subprocess.
569 SET_PGRP is nonzero if we should put the subprocess into a separate
572 CURRENT_DIR is an elisp string giving the path of the current
573 directory the subprocess should have. Since we can't really signal
574 a decent error from within the child, this should be verified as an
575 executable directory by the parent. */
577 child_setup (in
, out
, err
, new_argv
, set_pgrp
, current_dir
)
579 register char **new_argv
;
581 Lisp_Object current_dir
;
584 /* The MSDOS port of gcc cannot fork, vfork, ... so we must call system
586 #else /* not MSDOS */
592 #ifdef SET_EMACS_PRIORITY
594 extern int emacs_priority
;
596 if (emacs_priority
< 0)
597 nice (- emacs_priority
);
602 /* Close Emacs's descriptors that this process should not have. */
603 close_process_descs ();
607 /* Note that use of alloca is always safe here. It's obvious for systems
608 that do not have true vfork or that have true (stack) alloca.
609 If using vfork and C_ALLOCA it is safe because that changes
610 the superior's static variables as if the superior had done alloca
611 and will be cleaned up in the usual way. */
616 i
= XSTRING (current_dir
)->size
;
617 pwd_var
= (char *) alloca (i
+ 6);
619 bcopy ("PWD=", pwd_var
, 4);
620 bcopy (XSTRING (current_dir
)->data
, temp
, i
);
621 if (temp
[i
- 1] != '/') temp
[i
++] = '/';
624 /* We can't signal an Elisp error here; we're in a vfork. Since
625 the callers check the current directory before forking, this
626 should only return an error if the directory's permissions
627 are changed between the check and this chdir, but we should
629 if (chdir (temp
) < 0)
632 /* Strip trailing slashes for PWD, but leave "/" and "//" alone. */
633 while (i
> 2 && temp
[i
- 1] == '/')
637 /* Set `env' to a vector of the strings in Vprocess_environment. */
639 register Lisp_Object tem
;
640 register char **new_env
;
641 register int new_length
;
644 for (tem
= Vprocess_environment
;
645 CONSP (tem
) && STRINGP (XCONS (tem
)->car
);
646 tem
= XCONS (tem
)->cdr
)
649 /* new_length + 2 to include PWD and terminating 0. */
650 env
= new_env
= (char **) alloca ((new_length
+ 2) * sizeof (char *));
652 /* If we have a PWD envvar, pass one down,
653 but with corrected value. */
655 *new_env
++ = pwd_var
;
657 /* Copy the Vprocess_environment strings into new_env. */
658 for (tem
= Vprocess_environment
;
659 CONSP (tem
) && STRINGP (XCONS (tem
)->car
);
660 tem
= XCONS (tem
)->cdr
)
663 char *string
= (char *) XSTRING (XCONS (tem
)->car
)->data
;
664 /* See if this string duplicates any string already in the env.
665 If so, don't put it in.
666 When an env var has multiple definitions,
667 we keep the definition that comes first in process-environment. */
668 for (; ep
!= new_env
; ep
++)
670 char *p
= *ep
, *q
= string
;
674 /* The string is malformed; might as well drop it. */
689 /* Make sure that in, out, and err are not actually already in
690 descriptors zero, one, or two; this could happen if Emacs is
691 started with its standard in, out, or error closed, as might
693 in
= relocate_fd (in
, 3);
695 err
= out
= relocate_fd (out
, 3);
698 out
= relocate_fd (out
, 3);
699 err
= relocate_fd (err
, 3);
714 #ifndef SETPGRP_RELEASES_CTTY
715 setpgrp (); /* No arguments but equivalent in this case */
720 /* setpgrp_of_tty is incorrect here; it uses input_fd. */
721 EMACS_SET_TTY_PGRP (0, &pid
);
724 something missing here
;
727 /* execvp does not accept an environment arg so the only way
728 to pass this environment is to set environ. Our caller
729 is responsible for restoring the ambient value of environ. */
731 execvp (new_argv
[0], new_argv
);
733 write (1, "Couldn't exec the program ", 26);
734 write (1, new_argv
[0], strlen (new_argv
[0]));
736 #endif /* not MSDOS */
739 /* Move the file descriptor FD so that its number is not less than MIN.
740 If the file descriptor is moved at all, the original is freed. */
742 relocate_fd (fd
, min
)
752 char *message1
= "Error while setting up child: ";
753 char *errmessage
= strerror (errno
);
754 char *message2
= "\n";
755 write (2, message1
, strlen (message1
));
756 write (2, errmessage
, strlen (errmessage
));
757 write (2, message2
, strlen (message2
));
760 /* Note that we hold the original FD open while we recurse,
761 to guarantee we'll get a new FD if we need it. */
762 new = relocate_fd (new, min
);
769 getenv_internal (var
, varlen
, value
, valuelen
)
777 for (scan
= Vprocess_environment
; CONSP (scan
); scan
= XCONS (scan
)->cdr
)
781 entry
= XCONS (scan
)->car
;
783 && XSTRING (entry
)->size
> varlen
784 && XSTRING (entry
)->data
[varlen
] == '='
785 && ! bcmp (XSTRING (entry
)->data
, var
, varlen
))
787 *value
= (char *) XSTRING (entry
)->data
+ (varlen
+ 1);
788 *valuelen
= XSTRING (entry
)->size
- (varlen
+ 1);
796 DEFUN ("getenv", Fgetenv
, Sgetenv
, 1, 1, 0,
797 "Return the value of environment variable VAR, as a string.\n\
798 VAR should be a string. Value is nil if VAR is undefined in the environment.\n\
799 This function consults the variable ``process-environment'' for its value.")
806 CHECK_STRING (var
, 0);
807 if (getenv_internal (XSTRING (var
)->data
, XSTRING (var
)->size
,
809 return make_string (value
, valuelen
);
814 /* A version of getenv that consults process_environment, easily
823 if (getenv_internal (var
, strlen (var
), &value
, &valuelen
))
831 /* This is run before init_cmdargs. */
835 char *data_dir
= egetenv ("EMACSDATA");
836 char *doc_dir
= egetenv ("EMACSDOC");
839 = Ffile_name_as_directory (build_string (data_dir
? data_dir
842 = Ffile_name_as_directory (build_string (doc_dir
? doc_dir
845 /* Check the EMACSPATH environment variable, defaulting to the
846 PATH_EXEC path from paths.h. */
847 Vexec_path
= decode_env_path ("EMACSPATH", PATH_EXEC
);
848 Vexec_directory
= Ffile_name_as_directory (Fcar (Vexec_path
));
849 Vexec_path
= nconc2 (decode_env_path ("PATH", ""), Vexec_path
);
852 /* This is run after init_cmdargs, so that Vinvocation_directory is valid. */
856 char *data_dir
= egetenv ("EMACSDATA");
861 if (initialized
&& !NILP (Vinstallation_directory
))
863 /* Add to the path the lib-src subdir of the installation dir. */
865 tem
= Fexpand_file_name (build_string ("lib-src"),
866 Vinstallation_directory
);
867 if (NILP (Fmember (tem
, Vexec_path
)))
870 /* MSDOS uses wrapped binaries, so don't do this. */
871 Vexec_path
= nconc2 (Vexec_path
, Fcons (tem
, Qnil
));
872 Vexec_directory
= Ffile_name_as_directory (tem
);
875 /* If we use ../lib-src, maybe use ../etc as well.
876 Do so if ../etc exists and has our DOC-... file in it. */
879 tem
= Fexpand_file_name (build_string ("etc"),
880 Vinstallation_directory
);
881 Vdoc_directory
= Ffile_name_as_directory (tem
);
886 /* Look for the files that should be in etc. We don't use
887 Vinstallation_directory, because these files are never installed
888 in /bin near the executable, and they are never in the build
889 directory when that's different from the source directory.
891 Instead, if these files are not in the nominal place, we try the
895 Lisp_Object tem
, tem1
, newdir
;
897 tem
= Fexpand_file_name (build_string ("GNU"), Vdata_directory
);
898 tem1
= Ffile_exists_p (tem
);
901 newdir
= Fexpand_file_name (build_string ("../etc/"),
902 build_string (PATH_DUMPLOADSEARCH
));
903 tem
= Fexpand_file_name (build_string ("GNU"), newdir
);
904 tem1
= Ffile_exists_p (tem
);
906 Vdata_directory
= newdir
;
910 tempdir
= Fdirectory_file_name (Vexec_directory
);
911 if (access (XSTRING (tempdir
)->data
, 0) < 0)
914 "Warning: arch-dependent data dir (%s) does not exist.\n",
915 XSTRING (Vexec_directory
)->data
);
919 tempdir
= Fdirectory_file_name (Vdata_directory
);
920 if (access (XSTRING (tempdir
)->data
, 0) < 0)
923 "Warning: arch-independent data dir (%s) does not exist.\n",
924 XSTRING (Vdata_directory
)->data
);
929 Vshell_file_name
= build_string ("*dcl*");
931 sh
= (char *) getenv ("SHELL");
932 Vshell_file_name
= build_string (sh
? sh
: "/bin/sh");
936 set_process_environment ()
938 register char **envp
;
940 Vprocess_environment
= Qnil
;
944 for (envp
= environ
; *envp
; envp
++)
945 Vprocess_environment
= Fcons (build_string (*envp
),
946 Vprocess_environment
);
952 Qbuffer_file_type
= intern ("buffer-file-type");
953 staticpro (&Qbuffer_file_type
);
955 DEFVAR_LISP ("binary-process-input", &Vbinary_process_input
,
956 "*If non-nil then new subprocesses are assumed to take binary input.");
957 Vbinary_process_input
= Qnil
;
959 DEFVAR_LISP ("binary-process-output", &Vbinary_process_output
,
960 "*If non-nil then new subprocesses are assumed to produce binary output.");
961 Vbinary_process_output
= Qnil
;
964 DEFVAR_LISP ("shell-file-name", &Vshell_file_name
,
965 "*File name to load inferior shells from.\n\
966 Initialized from the SHELL environment variable.");
968 DEFVAR_LISP ("exec-path", &Vexec_path
,
969 "*List of directories to search programs to run in subprocesses.\n\
970 Each element is a string (directory name) or nil (try default directory).");
972 DEFVAR_LISP ("exec-directory", &Vexec_directory
,
973 "Directory of architecture-dependent files that come with GNU Emacs,\n\
974 especially executable programs intended for Emacs to invoke.");
976 DEFVAR_LISP ("data-directory", &Vdata_directory
,
977 "Directory of architecture-independent files that come with GNU Emacs,\n\
978 intended for Emacs to use.");
980 DEFVAR_LISP ("doc-directory", &Vdoc_directory
,
981 "Directory containing the DOC file that comes with GNU Emacs.\n\
982 This is usually the same as data-directory.");
984 DEFVAR_LISP ("configure-info-directory", &Vconfigure_info_directory
,
985 "For internal use by the build procedure only.\n\
986 This is the name of the directory in which the build procedure installed\n\
987 Emacs's info files; the default value for Info-default-directory-list\n\
989 Vconfigure_info_directory
= build_string (PATH_INFO
);
991 DEFVAR_LISP ("process-environment", &Vprocess_environment
,
992 "List of environment variables for subprocesses to inherit.\n\
993 Each element should be a string of the form ENVVARNAME=VALUE.\n\
994 The environment which Emacs inherits is placed in this variable\n\
995 when Emacs starts.");
998 defsubr (&Scall_process
);
1001 defsubr (&Scall_process_region
);