Mercurial > emacs
comparison src/callproc.c @ 5154:e4e66bcaa016
(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.
| author | Richard M. Stallman <rms@gnu.org> |
|---|---|
| date | Wed, 24 Nov 1993 06:37:13 +0000 |
| parents | 81c44a01ddda |
| children | 2a1492764d5e |
comparison
equal
deleted
inserted
replaced
| 5153:27afcc69725a | 5154:e4e66bcaa016 |
|---|---|
| 79 char *synch_process_death; | 79 char *synch_process_death; |
| 80 | 80 |
| 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 |
| 87 static Lisp_Object | 89 static Lisp_Object |
| 88 call_process_kill (fdpid) | 90 call_process_kill (fdpid) |
| 634 return 0; | 636 return 0; |
| 635 } | 637 } |
| 636 | 638 |
| 637 #endif /* not VMS */ | 639 #endif /* not VMS */ |
| 638 | 640 |
| 639 init_callproc () | 641 /* This is run before init_cmdargs. */ |
| 640 { | 642 |
| 641 register char * sh; | 643 init_callproc_1 () |
| 642 Lisp_Object tempdir; | 644 { |
| 643 | 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) |
| 660 { | 697 { |
| 661 printf ("Warning: arch-dependent data dir (%s) does not exist.\n", | 698 printf ("Warning: arch-dependent data dir (%s) does not exist.\n", |
