aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2011-02-18 12:18:16 -0500
committerStefan Monnier2011-02-18 12:18:16 -0500
commitaa56f3613e788df186bef09e2b5414428140377a (patch)
tree270df0f00e2e9ec8f9df668bff84c4199d0169f8 /src
parent42af913dd467c574bb5ccb8825aab5881d9221e7 (diff)
downloademacs-aa56f3613e788df186bef09e2b5414428140377a.tar.gz
emacs-aa56f3613e788df186bef09e2b5414428140377a.zip
* lisp/files.el (cd): Make completion obey cd-path.
* lread.c (Qdir_ok): New constant. (syms_of_lread): Initialize it. (openp): Don't ignore directories if the predicate returns dir-ok. Fixes: debbugs:7924
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/lread.c17
2 files changed, 19 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 72a9287513d..9839c7fcc98 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12011-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * lread.c (Qdir_ok): New constant.
4 (syms_of_lread): Initialize it.
5 (openp): Don't ignore directories if the predicate returns dir-ok.
6
12011-02-18 Eli Zaretskii <eliz@gnu.org> 72011-02-18 Eli Zaretskii <eliz@gnu.org>
2 8
3 * xdisp.c (display_line): Fix the change made for bug#7939. 9 * xdisp.c (display_line): Fix the change made for bug#7939.
diff --git a/src/lread.c b/src/lread.c
index 7e410fcc334..855869cd90d 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1250,7 +1250,9 @@ If SUFFIXES is non-nil, it should be a list of suffixes to append to
1250file name when searching. 1250file name when searching.
1251If non-nil, PREDICATE is used instead of `file-readable-p'. 1251If non-nil, PREDICATE is used instead of `file-readable-p'.
1252PREDICATE can also be an integer to pass to the access(2) function, 1252PREDICATE can also be an integer to pass to the access(2) function,
1253in which case file-name-handlers are ignored. */) 1253in which case file-name-handlers are ignored.
1254This function will normally skip directories, so if you want it to find
1255directories, make sure the PREDICATE function returns `dir-ok' for them. */)
1254 (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, Lisp_Object predicate) 1256 (Lisp_Object filename, Lisp_Object path, Lisp_Object suffixes, Lisp_Object predicate)
1255{ 1257{
1256 Lisp_Object file; 1258 Lisp_Object file;
@@ -1260,6 +1262,7 @@ in which case file-name-handlers are ignored. */)
1260 return file; 1262 return file;
1261} 1263}
1262 1264
1265static Lisp_Object Qdir_ok;
1263 1266
1264/* Search for a file whose name is STR, looking in directories 1267/* Search for a file whose name is STR, looking in directories
1265 in the Lisp list PATH, and trying suffixes from SUFFIX. 1268 in the Lisp list PATH, and trying suffixes from SUFFIX.
@@ -1377,9 +1380,12 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes, Lisp_Object *sto
1377 if (NILP (predicate)) 1380 if (NILP (predicate))
1378 exists = !NILP (Ffile_readable_p (string)); 1381 exists = !NILP (Ffile_readable_p (string));
1379 else 1382 else
1380 exists = !NILP (call1 (predicate, string)); 1383 {
1381 if (exists && !NILP (Ffile_directory_p (string))) 1384 Lisp_Object tmp = call1 (predicate, string);
1382 exists = 0; 1385 exists = !NILP (tmp)
1386 && (EQ (tmp, Qdir_ok)
1387 || !NILP (Ffile_directory_p (string)));
1388 }
1383 1389
1384 if (exists) 1390 if (exists)
1385 { 1391 {
@@ -4377,6 +4383,9 @@ to load. See also `load-dangerous-libraries'. */);
4377 Qfile_truename = intern_c_string ("file-truename"); 4383 Qfile_truename = intern_c_string ("file-truename");
4378 staticpro (&Qfile_truename) ; 4384 staticpro (&Qfile_truename) ;
4379 4385
4386 Qdir_ok = intern_c_string ("dir-ok");
4387 staticpro (&Qdir_ok);
4388
4380 Qdo_after_load_evaluation = intern_c_string ("do-after-load-evaluation"); 4389 Qdo_after_load_evaluation = intern_c_string ("do-after-load-evaluation");
4381 staticpro (&Qdo_after_load_evaluation) ; 4390 staticpro (&Qdo_after_load_evaluation) ;
4382 4391