Mercurial > hg > xemacs-beta
comparison src/editfns.c @ 386:4af0ddfb7c5b r21-2-8
Import from CVS: tag r21-2-8
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:08:50 +0200 |
parents | 8626e4521993 |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
385:bc48d89bf15c | 386:4af0ddfb7c5b |
---|---|
819 { | 819 { |
820 cached_home_directory = NULL; /* in some cases, this may cause the leaking | 820 cached_home_directory = NULL; /* in some cases, this may cause the leaking |
821 of a few bytes */ | 821 of a few bytes */ |
822 } | 822 } |
823 | 823 |
824 /* Returns the home directory, in external format */ | |
824 char * | 825 char * |
825 get_home_directory (void) | 826 get_home_directory (void) |
826 { | 827 { |
827 int output_home_warning = 0; | 828 int output_home_warning = 0; |
828 | 829 |
876 output_home_warning = 1; | 877 output_home_warning = 1; |
877 #endif /* !WINDOWSNT */ | 878 #endif /* !WINDOWSNT */ |
878 } | 879 } |
879 if (initialized && output_home_warning) | 880 if (initialized && output_home_warning) |
880 { | 881 { |
881 warn_when_safe(Quser_files_and_directories, Qwarning, "\n" | 882 warn_when_safe (Quser_files_and_directories, Qwarning, "\n" |
882 " XEmacs was unable to determine a good value for the user's $HOME\n" | 883 " XEmacs was unable to determine a good value for the user's $HOME\n" |
883 " directory, and will be using the value:\n" | 884 " directory, and will be using the value:\n" |
884 " %s\n" | 885 " %s\n" |
885 " This is probably incorrect.", | 886 " This is probably incorrect.", |
886 cached_home_directory | 887 cached_home_directory |
887 ); | 888 ); |
888 } | 889 } |
889 } | 890 } |
890 return (cached_home_directory); | 891 return cached_home_directory; |
891 } | 892 } |
892 | 893 |
893 DEFUN ("user-home-directory", Fuser_home_directory, 0, 0, 0, /* | 894 DEFUN ("user-home-directory", Fuser_home_directory, 0, 0, 0, /* |
894 Return the user's home directory, as a string. | 895 Return the user's home directory, as a string. |
895 */ | 896 */ |
896 ()) | 897 ()) |
897 { | 898 { |
898 Lisp_Object directory; | 899 char *path = get_home_directory (); |
899 char *path; | 900 |
900 | 901 return path == NULL ? Qnil : |
901 directory = Qnil; | 902 Fexpand_file_name (Fsubstitute_in_file_name |
902 path = get_home_directory (); | 903 (build_ext_string (path, FORMAT_FILENAME)), |
903 if (path != NULL) | 904 Qnil); |
904 { | |
905 directory = | |
906 Fexpand_file_name (Fsubstitute_in_file_name (build_string (path)), | |
907 Qnil); | |
908 } | |
909 return (directory); | |
910 } | 905 } |
911 | 906 |
912 DEFUN ("system-name", Fsystem_name, 0, 0, 0, /* | 907 DEFUN ("system-name", Fsystem_name, 0, 0, 0, /* |
913 Return the name of the machine you are running on, as a string. | 908 Return the name of the machine you are running on, as a string. |
914 */ | 909 */ |