diff options
| author | Richard M. Stallman | 1993-11-24 06:37:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-11-24 06:37:13 +0000 |
| commit | 8de15d6981442ba62a6af96b0e8d3e0332efc12e (patch) | |
| tree | 596ae81766f6702c058fd839868173c063b5f300 /src | |
| parent | 9a974c88a93409fb120a7c179faeb0006f46a063 (diff) | |
| download | emacs-8de15d6981442ba62a6af96b0e8d3e0332efc12e.tar.gz emacs-8de15d6981442ba62a6af96b0e8d3e0332efc12e.zip | |
(init_callproc): Maybe add ../lib-src to exec-path
and maybe store it in exec-directory.
Maybe put ../etc into data-directory.
(init_callproc_1): Part of init_callproc is split out.
Diffstat (limited to 'src')
| -rw-r--r-- | src/callproc.c | 57 |
1 files changed, 47 insertions, 10 deletions
diff --git a/src/callproc.c b/src/callproc.c index 197f9c833ef..bd60d942552 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -81,6 +81,8 @@ char *synch_process_death; | |||
| 81 | /* If synch_process_death is zero, | 81 | /* If synch_process_death is zero, |
| 82 | this is exit code of synchronous subprocess. */ | 82 | this is exit code of synchronous subprocess. */ |
| 83 | int synch_process_retcode; | 83 | int synch_process_retcode; |
| 84 | |||
| 85 | extern Lisp_Object Vdoc_file_name; | ||
| 84 | 86 | ||
| 85 | #ifndef VMS /* VMS version is in vmsproc.c. */ | 87 | #ifndef VMS /* VMS version is in vmsproc.c. */ |
| 86 | 88 | ||
| @@ -636,24 +638,59 @@ egetenv (var) | |||
| 636 | 638 | ||
| 637 | #endif /* not VMS */ | 639 | #endif /* not VMS */ |
| 638 | 640 | ||
| 639 | init_callproc () | 641 | /* This is run before init_cmdargs. */ |
| 640 | { | ||
| 641 | register char * sh; | ||
| 642 | Lisp_Object tempdir; | ||
| 643 | 642 | ||
| 644 | { | 643 | init_callproc_1 () |
| 645 | char *data_dir = egetenv ("EMACSDATA"); | 644 | { |
| 645 | char *data_dir = egetenv ("EMACSDATA"); | ||
| 646 | 646 | ||
| 647 | Vdata_directory = | 647 | Vdata_directory |
| 648 | Ffile_name_as_directory | 648 | = Ffile_name_as_directory (build_string (data_dir ? data_dir |
| 649 | (build_string (data_dir ? data_dir : PATH_DATA)); | 649 | : PATH_DATA)); |
| 650 | } | ||
| 651 | 650 | ||
| 652 | /* Check the EMACSPATH environment variable, defaulting to the | 651 | /* Check the EMACSPATH environment variable, defaulting to the |
| 653 | PATH_EXEC path from paths.h. */ | 652 | PATH_EXEC path from paths.h. */ |
| 654 | Vexec_path = decode_env_path ("EMACSPATH", PATH_EXEC); | 653 | Vexec_path = decode_env_path ("EMACSPATH", PATH_EXEC); |
| 655 | Vexec_directory = Ffile_name_as_directory (Fcar (Vexec_path)); | 654 | Vexec_directory = Ffile_name_as_directory (Fcar (Vexec_path)); |
| 656 | Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path); | 655 | Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path); |
| 656 | } | ||
| 657 | |||
| 658 | /* This is run after init_cmdargs, so that Vinvocation_directory is valid. */ | ||
| 659 | |||
| 660 | init_callproc () | ||
| 661 | { | ||
| 662 | char *data_dir = egetenv ("EMACSDATA"); | ||
| 663 | |||
| 664 | register char * sh; | ||
| 665 | Lisp_Object tempdir; | ||
| 666 | |||
| 667 | if (initialized && !NILP (Vinvocation_directory)) | ||
| 668 | { | ||
| 669 | /* Add to the path the ../lib-src dir of the Emacs executable, | ||
| 670 | if that dir exists. */ | ||
| 671 | Lisp_Object tem, tem1; | ||
| 672 | tem = Fexpand_file_name (build_string ("../lib-src"), | ||
| 673 | Vinvocation_directory); | ||
| 674 | tem1 = Ffile_exists_p (tem); | ||
| 675 | if (!NILP (tem1) && NILP (Fmember (tem, Vexec_path))) | ||
| 676 | { | ||
| 677 | Vexec_path = nconc2 (Vexec_path, Fcons (tem, Qnil)); | ||
| 678 | Vexec_directory = Ffile_name_as_directory (tem); | ||
| 679 | |||
| 680 | /* If we use ../lib-src, maybe use ../etc as well. | ||
| 681 | Do so if ../etc exists and has our DOC-... file in it. */ | ||
| 682 | if (data_dir == 0) | ||
| 683 | { | ||
| 684 | Lisp_Object tem, tem2, tem3; | ||
| 685 | tem = Fexpand_file_name (build_string ("../etc"), | ||
| 686 | Vinvocation_directory); | ||
| 687 | tem2 = Fexpand_file_name (Vdoc_file_name, tem); | ||
| 688 | tem3 = Ffile_exists_p (tem2); | ||
| 689 | if (!NILP (tem2)) | ||
| 690 | Vdata_directory = tem; | ||
| 691 | } | ||
| 692 | } | ||
| 693 | } | ||
| 657 | 694 | ||
| 658 | tempdir = Fdirectory_file_name (Vexec_directory); | 695 | tempdir = Fdirectory_file_name (Vexec_directory); |
| 659 | if (access (XSTRING (tempdir)->data, 0) < 0) | 696 | if (access (XSTRING (tempdir)->data, 0) < 0) |