comparison src/lread.c @ 5211:cdca98f2d36f

Move `default-file-system-ignore-case' to C; fix bug in directory hash tables src/ChangeLog addition: 2010-05-16 Aidan Kehoe <kehoea@parhasard.net> Move `default-file-system-ignore-case' to C; pay attention to it in creating the directory hash tables for #'locate-file. Fix a bug where #'eq was specified when creating directory hash tables in dired.c. * config.h.in (DEFAULT_FILE_SYSTEM_IGNORE_CASE): This is 1 on Darwin. * dired.c (make_directory_hash_table): If #'file-system-ignore-case-p gives non-nil for a directory, created the associated hash table with #'equalp as its test. Never use #'eq as a directory hash table test. * fileio.c (vars_of_fileio): Move `default-file-system-ignore-case' here, so it can be a constant boolean reflecting a compile-time #define. * lisp.h: Update the declaration of make_directory_hash_table; remove the declaration of wasteful_word_to_lisp, which was #ifdef'd out. * lread.c (Flocate_file): Take out a debugging statement from this function. (locate_file_refresh_hashing): Call make_directory_hash_table with a Lisp string, not an Ibyte pointer. (vars_of_lread): If DEFAULT_FILE_SYSTEM_IGNORE_CASE is defined, use #'equalp as the hash table test for locate-file-hash-table, not #'equal. * s/win32-common.h (DEFAULT_FILE_SYSTEM_IGNORE_CASE): Case should normally be ignored in file names on Win32. lisp/ChangeLog addition: 2010-05-16 Aidan Kehoe <kehoea@parhasard.net> * files.el (default-file-system-ignore-case): Move this to fileio.c, where it's a constant boolean variable initialised at dump time.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 16 May 2010 12:33:21 +0100
parents 71ee43b8a74d
children 7abb91db1e64
comparison
equal deleted inserted replaced
5208:9fa29ec759e3 5211:cdca98f2d36f
892 */ 892 */
893 (filename, path_list, suffixes, mode)) 893 (filename, path_list, suffixes, mode))
894 { 894 {
895 /* This function can GC */ 895 /* This function can GC */
896 Lisp_Object tp; 896 Lisp_Object tp;
897 static int locate_file_called;
898
899 ++locate_file_called;
900 897
901 CHECK_STRING (filename); 898 CHECK_STRING (filename);
902 899
903 if (LISTP (suffixes)) 900 if (LISTP (suffixes))
904 { 901 {
916 better have been through Fexpand_file_name() by now. */ 913 better have been through Fexpand_file_name() by now. */
917 914
918 static Lisp_Object 915 static Lisp_Object
919 locate_file_refresh_hashing (Lisp_Object directory) 916 locate_file_refresh_hashing (Lisp_Object directory)
920 { 917 {
921 Lisp_Object hash = 918 Lisp_Object hash = make_directory_hash_table (directory);
922 make_directory_hash_table (XSTRING_DATA (directory));
923 919
924 if (!NILP (hash)) 920 if (!NILP (hash))
925 Fputhash (directory, hash, Vlocate_file_hash_table); 921 Fputhash (directory, hash, Vlocate_file_hash_table);
926 return hash; 922 return hash;
927 } 923 }
3481 Vread_objects = Qnil; 3477 Vread_objects = Qnil;
3482 staticpro (&Vread_objects); 3478 staticpro (&Vread_objects);
3483 3479
3484 Vlocate_file_hash_table = make_lisp_hash_table (200, 3480 Vlocate_file_hash_table = make_lisp_hash_table (200,
3485 HASH_TABLE_NON_WEAK, 3481 HASH_TABLE_NON_WEAK,
3486 Qequal); 3482 #ifdef DEFAULT_FILE_SYSTEM_IGNORE_CASE
3483 Qequalp
3484 #else
3485 Qequal
3486 #endif
3487 );
3487 staticpro (&Vlocate_file_hash_table); 3488 staticpro (&Vlocate_file_hash_table);
3488 #ifdef DEBUG_XEMACS 3489 #ifdef DEBUG_XEMACS
3489 symbol_value (XSYMBOL (intern ("Vlocate-file-hash-table"))) 3490 symbol_value (XSYMBOL (intern ("Vlocate-file-hash-table")))
3490 = Vlocate_file_hash_table; 3491 = Vlocate_file_hash_table;
3491 #endif 3492 #endif