HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement token threading
[bpt/emacs.git]
/
src
/
callproc.c
diff --git
a/src/callproc.c
b/src/callproc.c
index
1bdb57a
..
facca88
100644
(file)
--- a/
src/callproc.c
+++ b/
src/callproc.c
@@
-1,5
+1,5
@@
/* Synchronous subprocess invocation for GNU Emacs.
/* Synchronous subprocess invocation for GNU Emacs.
- Copyright (C) 1985-1988, 1993-1995, 1999-201
1
+ Copyright (C) 1985-1988, 1993-1995, 1999-201
2
Free Software Foundation, Inc.
This file is part of GNU Emacs.
Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@
-44,8
+44,8
@@
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif /* MSDOS */
#include "commands.h"
#endif /* MSDOS */
#include "commands.h"
-#include "buffer.h"
#include "character.h"
#include "character.h"
+#include "buffer.h"
#include "ccl.h"
#include "coding.h"
#include "composite.h"
#include "ccl.h"
#include "coding.h"
#include "composite.h"
@@
-61,6
+61,10
@@
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "msdos.h"
#endif
#include "msdos.h"
#endif
+#ifdef HAVE_NS
+#include "nsterm.h"
+#endif
+
#ifndef USE_CRT_DLL
extern char **environ;
#endif
#ifndef USE_CRT_DLL
extern char **environ;
#endif
@@
-97,13
+101,15
@@
int synch_process_retcode;
/* Nonzero if this is termination due to exit. */
static int call_process_exited;
/* Nonzero if this is termination due to exit. */
static int call_process_exited;
-static Lisp_Object Fgetenv_internal (Lisp_Object, Lisp_Object);
-
static Lisp_Object
call_process_kill (Lisp_Object fdpid)
{
static Lisp_Object
call_process_kill (Lisp_Object fdpid)
{
- emacs_close (XFASTINT (Fcar (fdpid)));
- EMACS_KILLPG (XFASTINT (Fcdr (fdpid)), SIGKILL);
+ int fd;
+ pid_t pid;
+ CONS_TO_INTEGER (Fcar (fdpid), int, fd);
+ CONS_TO_INTEGER (Fcdr (fdpid), pid_t, pid);
+ emacs_close (fd);
+ EMACS_KILLPG (pid, SIGKILL);
synch_process_alive = 0;
return Qnil;
}
synch_process_alive = 0;
return Qnil;
}
@@
-112,18
+118,18
@@
static Lisp_Object
call_process_cleanup (Lisp_Object arg)
{
Lisp_Object fdpid = Fcdr (arg);
call_process_cleanup (Lisp_Object arg)
{
Lisp_Object fdpid = Fcdr (arg);
+ int fd;
#if defined (MSDOS)
Lisp_Object file;
#if defined (MSDOS)
Lisp_Object file;
- int fd;
#else
#else
-
in
t pid;
+
pid_
t pid;
#endif
Fset_buffer (Fcar (arg));
#endif
Fset_buffer (Fcar (arg));
+ CONS_TO_INTEGER (Fcar (fdpid), int, fd);
#if defined (MSDOS)
/* for MSDOS fdpid is really (fd . tempfile) */
#if defined (MSDOS)
/* for MSDOS fdpid is really (fd . tempfile) */
- fd = XFASTINT (Fcar (fdpid));
file = Fcdr (fdpid);
/* FD is -1 and FILE is "" when we didn't actually create a
temporary file in call-process. */
file = Fcdr (fdpid);
/* FD is -1 and FILE is "" when we didn't actually create a
temporary file in call-process. */
@@
-132,17
+138,17
@@
call_process_cleanup (Lisp_Object arg)
if (!(strcmp (SDATA (file), NULL_DEVICE) == 0 || SREF (file, 0) == '\0'))
unlink (SDATA (file));
#else /* not MSDOS */
if (!(strcmp (SDATA (file), NULL_DEVICE) == 0 || SREF (file, 0) == '\0'))
unlink (SDATA (file));
#else /* not MSDOS */
-
pid = XFASTINT (Fcdr (fdpid)
);
+
CONS_TO_INTEGER (Fcdr (fdpid), pid_t, pid
);
if (call_process_exited)
{
if (call_process_exited)
{
- emacs_close (
XFASTINT (Fcar (fdpid))
);
+ emacs_close (
fd
);
return Qnil;
}
if (EMACS_KILLPG (pid, SIGINT) == 0)
{
return Qnil;
}
if (EMACS_KILLPG (pid, SIGINT) == 0)
{
-
in
t count = SPECPDL_INDEX ();
+
ptrdiff_
t count = SPECPDL_INDEX ();
record_unwind_protect (call_process_kill, fdpid);
message1 ("Waiting for process to die...(type C-g again to kill it instantly)");
immediate_quit = 1;
record_unwind_protect (call_process_kill, fdpid);
message1 ("Waiting for process to die...(type C-g again to kill it instantly)");
immediate_quit = 1;
@@
-153,7
+159,7
@@
call_process_cleanup (Lisp_Object arg)
message1 ("Waiting for process to die...done");
}
synch_process_alive = 0;
message1 ("Waiting for process to die...done");
}
synch_process_alive = 0;
- emacs_close (
XFASTINT (Fcar (fdpid))
);
+ emacs_close (
fd
);
#endif /* not MSDOS */
return Qnil;
}
#endif /* not MSDOS */
return Qnil;
}
@@
-164,7
+170,8
@@
The remaining arguments are optional.
The program's input comes from file INFILE (nil means `/dev/null').
Insert output in BUFFER before point; t means current buffer; nil for BUFFER
means discard it; 0 means discard and don't wait; and `(:file FILE)', where
The program's input comes from file INFILE (nil means `/dev/null').
Insert output in BUFFER before point; t means current buffer; nil for BUFFER
means discard it; 0 means discard and don't wait; and `(:file FILE)', where
- FILE is a file name string, means that it should be written to that file.
+ FILE is a file name string, means that it should be written to that file
+ \(if the file already exists it is overwritten).
BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
REAL-BUFFER says what to do with standard output, as above,
while STDERR-FILE says what to do with standard error in the child.
BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
REAL-BUFFER says what to do with standard output, as above,
while STDERR-FILE says what to do with standard error in the child.
@@
-186,17
+193,16
@@
If you quit, the process is killed with SIGINT, or SIGKILL if you quit again.
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
- Lisp_Object infile, buffer, current_dir, path;
-
volatile int display_p_volatile
;
+ Lisp_Object infile, buffer, current_dir, path
, cleanup_info_tail
;
+
int display_p
;
int fd[2];
int filefd;
int fd[2];
int filefd;
- register int pid;
#define CALLPROC_BUFFER_SIZE_MIN (16 * 1024)
#define CALLPROC_BUFFER_SIZE_MAX (4 * CALLPROC_BUFFER_SIZE_MIN)
char buf[CALLPROC_BUFFER_SIZE_MAX];
int bufsize = CALLPROC_BUFFER_SIZE_MIN;
#define CALLPROC_BUFFER_SIZE_MIN (16 * 1024)
#define CALLPROC_BUFFER_SIZE_MAX (4 * CALLPROC_BUFFER_SIZE_MIN)
char buf[CALLPROC_BUFFER_SIZE_MAX];
int bufsize = CALLPROC_BUFFER_SIZE_MIN;
-
in
t count = SPECPDL_INDEX ();
-
volatile
USE_SAFE_ALLOCA;
+
ptrdiff_
t count = SPECPDL_INDEX ();
+ USE_SAFE_ALLOCA;
register const unsigned char **new_argv;
/* File to use for stderr in the child.
register const unsigned char **new_argv;
/* File to use for stderr in the child.
@@
-206,6
+212,9
@@
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
#ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
char *outf, *tempfile = NULL;
int outfilefd;
#ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
char *outf, *tempfile = NULL;
int outfilefd;
+ int pid;
+#else
+ pid_t pid;
#endif
int fd_output = -1;
struct coding_system process_coding; /* coding-system of process output */
#endif
int fd_output = -1;
struct coding_system process_coding; /* coding-system of process output */
@@
-370,7
+379,7
@@
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
UNGCPRO;
}
UNGCPRO;
}
- display_p
_volatile
= INTERACTIVE && nargs >= 4 && !NILP (args[3]);
+ display_p = INTERACTIVE && nargs >= 4 && !NILP (args[3]);
filefd = emacs_open (SSDATA (infile), O_RDONLY, 0);
if (filefd < 0)
filefd = emacs_open (SSDATA (infile), O_RDONLY, 0);
if (filefd < 0)
@@
-606,10
+615,13
@@
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
Lisp_Object volatile buffer_volatile = buffer;
Lisp_Object volatile coding_systems_volatile = coding_systems;
Lisp_Object volatile current_dir_volatile = current_dir;
Lisp_Object volatile buffer_volatile = buffer;
Lisp_Object volatile coding_systems_volatile = coding_systems;
Lisp_Object volatile current_dir_volatile = current_dir;
+ int volatile display_p_volatile = display_p;
int volatile fd1_volatile = fd1;
int volatile fd_error_volatile = fd_error;
int volatile fd_output_volatile = fd_output;
int volatile output_to_buffer_volatile = output_to_buffer;
int volatile fd1_volatile = fd1;
int volatile fd_error_volatile = fd_error;
int volatile fd_output_volatile = fd_output;
int volatile output_to_buffer_volatile = output_to_buffer;
+ int volatile sa_must_free_volatile = sa_must_free;
+ ptrdiff_t volatile sa_count_volatile = sa_count;
unsigned char const **volatile new_argv_volatile = new_argv;
pid = vfork ();
unsigned char const **volatile new_argv_volatile = new_argv;
pid = vfork ();
@@
-617,10
+629,13
@@
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
buffer = buffer_volatile;
coding_systems = coding_systems_volatile;
current_dir = current_dir_volatile;
buffer = buffer_volatile;
coding_systems = coding_systems_volatile;
current_dir = current_dir_volatile;
+ display_p = display_p_volatile;
fd1 = fd1_volatile;
fd_error = fd_error_volatile;
fd_output = fd_output_volatile;
output_to_buffer = output_to_buffer_volatile;
fd1 = fd1_volatile;
fd_error = fd_error_volatile;
fd_output = fd_output_volatile;
output_to_buffer = output_to_buffer_volatile;
+ sa_must_free = sa_must_free_volatile;
+ sa_count = sa_count_volatile;
new_argv = new_argv_volatile;
}
new_argv = new_argv_volatile;
}
@@
-639,7
+654,7
@@
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
/* GConf causes us to ignore SIGPIPE, make sure it is restored
in the child. */
/* GConf causes us to ignore SIGPIPE, make sure it is restored
in the child. */
-
//
signal (SIGPIPE, SIG_DFL);
+ signal (SIGPIPE, SIG_DFL);
#ifdef HAVE_WORKING_VFORK
pthread_sigmask (SIG_SETMASK, &procmask, 0);
#endif
#ifdef HAVE_WORKING_VFORK
pthread_sigmask (SIG_SETMASK, &procmask, 0);
#endif
@@
-691,18
+706,16
@@
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
/* Enable sending signal if user quits below. */
call_process_exited = 0;
/* Enable sending signal if user quits below. */
call_process_exited = 0;
-#if defined(MSDOS)
+#if defined
(MSDOS)
/* MSDOS needs different cleanup information. */
/* MSDOS needs different cleanup information. */
- record_unwind_protect (call_process_cleanup,
- Fcons (Fcurrent_buffer (),
- Fcons (make_number (fd[0]),
- build_string (tempfile ? tempfile : ""))));
+ cleanup_info_tail = build_string (tempfile ? tempfile : "");
#else
#else
+ cleanup_info_tail = INTEGER_TO_CONS (pid);
+#endif /* not MSDOS */
record_unwind_protect (call_process_cleanup,
Fcons (Fcurrent_buffer (),
record_unwind_protect (call_process_cleanup,
Fcons (Fcurrent_buffer (),
- Fcons (make_number (fd[0]), make_number (pid))));
-#endif /* not MSDOS */
-
+ Fcons (INTEGER_TO_CONS (fd[0]),
+ cleanup_info_tail)));
if (BUFFERP (buffer))
Fset_buffer (buffer);
if (BUFFERP (buffer))
Fset_buffer (buffer);
@@
-712,6
+725,7
@@
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
/* If BUFFER is nil, we must read process output once and then
discard it, so setup coding system but with nil. */
setup_coding_system (Qnil, &process_coding);
/* If BUFFER is nil, we must read process output once and then
discard it, so setup coding system but with nil. */
setup_coding_system (Qnil, &process_coding);
+ process_coding.dst_multibyte = 0;
}
else
{
}
else
{
@@
-747,18
+761,20
@@
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
&& !NILP (val))
val = raw_text_coding_system (val);
setup_coding_system (val, &process_coding);
&& !NILP (val))
val = raw_text_coding_system (val);
setup_coding_system (val, &process_coding);
+ process_coding.dst_multibyte
+ = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
}
}
+ process_coding.src_multibyte = 0;
immediate_quit = 1;
QUIT;
if (output_to_buffer)
{
immediate_quit = 1;
QUIT;
if (output_to_buffer)
{
- register
EMACS_INT
nread;
+ register
int
nread;
int first = 1;
EMACS_INT total_read = 0;
int carryover = 0;
int first = 1;
EMACS_INT total_read = 0;
int carryover = 0;
- int display_p = display_p_volatile;
int display_on_the_fly = display_p;
struct coding_system saved_coding;
int display_on_the_fly = display_p;
struct coding_system saved_coding;
@@
-801,7
+817,7
@@
usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
else
{ /* We have to decode the input. */
Lisp_Object curbuf;
else
{ /* We have to decode the input. */
Lisp_Object curbuf;
-
in
t count1 = SPECPDL_INDEX ();
+
ptrdiff_
t count1 = SPECPDL_INDEX ();
XSETBUFFER (curbuf, current_buffer);
/* We cannot allow after-change-functions be run
XSETBUFFER (curbuf, current_buffer);
/* We cannot allow after-change-functions be run
@@
-920,7
+936,7
@@
static Lisp_Object
delete_temp_file (Lisp_Object name)
{
/* Suppress jka-compr handling, etc. */
delete_temp_file (Lisp_Object name)
{
/* Suppress jka-compr handling, etc. */
-
in
t count = SPECPDL_INDEX ();
+
ptrdiff_
t count = SPECPDL_INDEX ();
specbind (intern ("file-name-handler-alist"), Qnil);
internal_delete_file (name);
unbind_to (count, Qnil);
specbind (intern ("file-name-handler-alist"), Qnil);
internal_delete_file (name);
unbind_to (count, Qnil);
@@
-936,7
+952,7
@@
Delete the text if fourth arg DELETE is non-nil.
Insert output in BUFFER before point; t means current buffer; nil for
BUFFER means discard it; 0 means discard and don't wait; and `(:file
FILE)', where FILE is a file name string, means that it should be
Insert output in BUFFER before point; t means current buffer; nil for
BUFFER means discard it; 0 means discard and don't wait; and `(:file
FILE)', where FILE is a file name string, means that it should be
- written to that file.
+ written to that file
(if the file already exists it is overwritten)
.
BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
REAL-BUFFER says what to do with standard output, as above,
while STDERR-FILE says what to do with standard error in the child.
BUFFER can also have the form (REAL-BUFFER STDERR-FILE); in that case,
REAL-BUFFER says what to do with standard output, as above,
while STDERR-FILE says what to do with standard error in the child.
@@
-957,7
+973,7
@@
usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
struct gcpro gcpro1;
Lisp_Object filename_string;
register Lisp_Object start, end;
struct gcpro gcpro1;
Lisp_Object filename_string;
register Lisp_Object start, end;
-
in
t count = SPECPDL_INDEX ();
+
ptrdiff_
t count = SPECPDL_INDEX ();
/* Qt denotes we have not yet called Ffind_operation_coding_system. */
Lisp_Object coding_systems;
Lisp_Object val, *args2;
/* Qt denotes we have not yet called Ffind_operation_coding_system. */
Lisp_Object coding_systems;
Lisp_Object val, *args2;
@@
-1001,7
+1017,7
@@
usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
UNBLOCK_INPUT;
if (fd == -1)
report_file_error ("Failed to open temporary file",
UNBLOCK_INPUT;
if (fd == -1)
report_file_error ("Failed to open temporary file",
- Fcons (
Vtemp_file_name_pattern
, Qnil));
+ Fcons (
build_string (tempfile)
, Qnil));
else
close (fd);
}
else
close (fd);
}
@@
-1034,7
+1050,7
@@
usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
val = complement_process_encoding_system (val);
{
val = complement_process_encoding_system (val);
{
-
in
t count1 = SPECPDL_INDEX ();
+
ptrdiff_
t count1 = SPECPDL_INDEX ();
specbind (intern ("coding-system-for-write"), val);
/* POSIX lets mk[s]temp use "."; don't invoke jka-compr if we
specbind (intern ("coding-system-for-write"), val);
/* POSIX lets mk[s]temp use "."; don't invoke jka-compr if we
@@
-1134,7
+1150,7
@@
child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
HANDLE handles[3];
#endif /* WINDOWSNT */
HANDLE handles[3];
#endif /* WINDOWSNT */
-
in
t pid = getpid ();
+
pid_
t pid = getpid ();
/* Close Emacs's descriptors that this process should not have. */
close_process_descs ();
/* Close Emacs's descriptors that this process should not have. */
close_process_descs ();
@@
-1160,9
+1176,9
@@
child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
/* MSDOS must have all environment variables malloc'ed, because
low-level libc functions that launch subsidiary processes rely
on that. */
/* MSDOS must have all environment variables malloc'ed, because
low-level libc functions that launch subsidiary processes rely
on that. */
- pwd_var =
(char *)
xmalloc (i + 6);
+ pwd_var = xmalloc (i + 6);
#else
#else
- pwd_var =
(char *)
alloca (i + 6);
+ pwd_var = alloca (i + 6);
#endif
temp = pwd_var + 4;
memcpy (pwd_var, "PWD=", 4);
#endif
temp = pwd_var + 4;
memcpy (pwd_var, "PWD=", 4);
@@
-1230,7
+1246,7
@@
child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
}
/* new_length + 2 to include PWD and terminating 0. */
}
/* new_length + 2 to include PWD and terminating 0. */
- env = new_env =
(char **) alloca ((new_length + 2) * sizeof (char *)
);
+ env = new_env =
alloca ((new_length + 2) * sizeof *env
);
/* If we have a PWD envvar, pass one down,
but with corrected value. */
if (egetenv ("PWD"))
/* If we have a PWD envvar, pass one down,
but with corrected value. */
if (egetenv ("PWD"))
@@
-1238,7
+1254,7
@@
child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
if (STRINGP (display))
{
if (STRINGP (display))
{
- char *vdata =
(char *)
alloca (sizeof "DISPLAY=" + SBYTES (display));
+ char *vdata = alloca (sizeof "DISPLAY=" + SBYTES (display));
strcpy (vdata, "DISPLAY=");
strcat (vdata, SSDATA (display));
new_env = add_env (env, new_env, vdata);
strcpy (vdata, "DISPLAY=");
strcat (vdata, SSDATA (display));
new_env = add_env (env, new_env, vdata);
@@
-1315,7
+1331,7
@@
child_setup (int in, int out, int err, register char **new_argv, int set_pgrp, L
if (err != in && err != out)
emacs_close (err);
if (err != in && err != out)
emacs_close (err);
-#if defined(USG)
+#if defined
(USG)
#ifndef SETPGRP_RELEASES_CTTY
setpgrp (); /* No arguments but equivalent in this case */
#endif
#ifndef SETPGRP_RELEASES_CTTY
setpgrp (); /* No arguments but equivalent in this case */
#endif
@@
-1501,18
+1517,37
@@
init_callproc_1 (void)
{
char *data_dir = egetenv ("EMACSDATA");
char *doc_dir = egetenv ("EMACSDOC");
{
char *data_dir = egetenv ("EMACSDATA");
char *doc_dir = egetenv ("EMACSDOC");
+#ifdef HAVE_NS
+ const char *etc_dir = ns_etc_directory ();
+ const char *path_exec = ns_exec_path ();
+#endif
Vdata_directory
= Ffile_name_as_directory (build_string (data_dir ? data_dir
Vdata_directory
= Ffile_name_as_directory (build_string (data_dir ? data_dir
- : PATH_DATA));
+#ifdef HAVE_NS
+ : (etc_dir ? etc_dir : PATH_DATA)
+#else
+ : PATH_DATA
+#endif
+ ));
Vdoc_directory
= Ffile_name_as_directory (build_string (doc_dir ? doc_dir
Vdoc_directory
= Ffile_name_as_directory (build_string (doc_dir ? doc_dir
- : PATH_DOC));
+#ifdef HAVE_NS
+ : (etc_dir ? etc_dir : PATH_DOC)
+#else
+ : PATH_DOC
+#endif
+ ));
/* Check the EMACSPATH environment variable, defaulting to the
PATH_EXEC path from epaths.h. */
/* Check the EMACSPATH environment variable, defaulting to the
PATH_EXEC path from epaths.h. */
- Vexec_path = decode_env_path ("EMACSPATH", PATH_EXEC);
+ Vexec_path = decode_env_path ("EMACSPATH",
+#ifdef HAVE_NS
+ path_exec ? path_exec :
+#endif
+ PATH_EXEC);
Vexec_directory = Ffile_name_as_directory (Fcar (Vexec_path));
Vexec_directory = Ffile_name_as_directory (Fcar (Vexec_path));
+ /* FIXME? For ns, path_exec should go at the front? */
Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
}
Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
}
@@
-1525,6
+1560,17
@@
init_callproc (void)
register char * sh;
Lisp_Object tempdir;
register char * sh;
Lisp_Object tempdir;
+#ifdef HAVE_NS
+ if (data_dir == 0)
+ {
+ const char *etc_dir = ns_etc_directory ();
+ if (etc_dir)
+ {
+ data_dir = alloca (strlen (etc_dir) + 1);
+ strcpy (data_dir, etc_dir);
+ }
+ }
+#endif
if (!NILP (Vinstallation_directory))
{
if (!NILP (Vinstallation_directory))
{
@@
-1536,7
+1582,14
@@
init_callproc (void)
/* MSDOS uses wrapped binaries, so don't do this. */
if (NILP (Fmember (tem, Vexec_path)))
{
/* MSDOS uses wrapped binaries, so don't do this. */
if (NILP (Fmember (tem, Vexec_path)))
{
- Vexec_path = decode_env_path ("EMACSPATH", PATH_EXEC);
+#ifdef HAVE_NS
+ const char *path_exec = ns_exec_path ();
+#endif
+ Vexec_path = decode_env_path ("EMACSPATH",
+#ifdef HAVE_NS
+ path_exec ? path_exec :
+#endif
+ PATH_EXEC);
Vexec_path = Fcons (tem, Vexec_path);
Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
}
Vexec_path = Fcons (tem, Vexec_path);
Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
}
@@
-1632,16
+1685,16
@@
syms_of_callproc (void)
staticpro (&Vtemp_file_name_pattern);
DEFVAR_LISP ("shell-file-name", Vshell_file_name,
staticpro (&Vtemp_file_name_pattern);
DEFVAR_LISP ("shell-file-name", Vshell_file_name,
- doc: /*
*
File name to load inferior shells from.
+ doc: /* File name to load inferior shells from.
Initialized from the SHELL environment variable, or to a system-dependent
default if SHELL is not set. */);
DEFVAR_LISP ("exec-path", Vexec_path,
Initialized from the SHELL environment variable, or to a system-dependent
default if SHELL is not set. */);
DEFVAR_LISP ("exec-path", Vexec_path,
- doc: /*
*
List of directories to search programs to run in subprocesses.
+ doc: /* List of directories to search programs to run in subprocesses.
Each element is a string (directory name) or nil (try default directory). */);
DEFVAR_LISP ("exec-suffixes", Vexec_suffixes,
Each element is a string (directory name) or nil (try default directory). */);
DEFVAR_LISP ("exec-suffixes", Vexec_suffixes,
- doc: /*
*
List of suffixes to try to find executable file names.
+ doc: /* List of suffixes to try to find executable file names.
Each element is a string. */);
Vexec_suffixes = Qnil;
Each element is a string. */);
Vexec_suffixes = Qnil;