5911 |
if (NILP (Vread_file_name_predicate) |
if (NILP (Vread_file_name_predicate) |
5912 |
|| EQ (Vread_file_name_predicate, Qfile_exists_p)) |
|| EQ (Vread_file_name_predicate, Qfile_exists_p)) |
5913 |
return all; |
return all; |
5914 |
GCPRO3 (all, comp, specdir); |
|
5915 |
count = specpdl_ptr - specpdl; |
#ifndef VMS |
5916 |
record_unwind_protect (read_file_name_cleanup, current_buffer->directory); |
if (EQ (Vread_file_name_predicate, Qfile_directory_p)) |
5917 |
current_buffer->directory = realdir; |
{ |
5918 |
for (comp = Qnil; CONSP (all); all = XCDR (all)) |
/* Brute-force speed up for directory checking: |
5919 |
if (!NILP (call1 (Vread_file_name_predicate, XCAR (all)))) |
Discard strings which don't end in a slash. */ |
5920 |
comp = Fcons (XCAR (all), comp); |
for (comp = Qnil; CONSP (all); all = XCDR (all)) |
5921 |
unbind_to (count, Qnil); |
{ |
5922 |
UNGCPRO; |
Lisp_Object tem = XCAR (all); |
5923 |
|
int len; |
5924 |
|
if (STRINGP (tem) && |
5925 |
|
(len = XSTRING (tem)->size, len > 0) && |
5926 |
|
IS_DIRECTORY_SEP (XSTRING (tem)->data[len-1])) |
5927 |
|
comp = Fcons (tem, comp); |
5928 |
|
} |
5929 |
|
} |
5930 |
|
else |
5931 |
|
#endif |
5932 |
|
{ |
5933 |
|
/* Must do it the hard (and slow) way. */ |
5934 |
|
GCPRO3 (all, comp, specdir); |
5935 |
|
count = specpdl_ptr - specpdl; |
5936 |
|
record_unwind_protect (read_file_name_cleanup, current_buffer->directory); |
5937 |
|
current_buffer->directory = realdir; |
5938 |
|
for (comp = Qnil; CONSP (all); all = XCDR (all)) |
5939 |
|
if (!NILP (call1 (Vread_file_name_predicate, XCAR (all)))) |
5940 |
|
comp = Fcons (XCAR (all), comp); |
5941 |
|
unbind_to (count, Qnil); |
5942 |
|
UNGCPRO; |
5943 |
|
} |
5944 |
return Fnreverse (comp); |
return Fnreverse (comp); |
5945 |
} |
} |
5946 |
|
|