bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23650: Use of locate-file for directories is underdocumented


From: Noam Postavsky
Subject: bug#23650: Use of locate-file for directories is underdocumented
Date: Tue, 30 Jan 2018 22:40:59 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

tags 23650 fixed
close 23650 26.1
quit

Nikolay Kudryavtsev <nikolay.kudryavtsev@gmail.com> writes:

> 1. According to the docstring it would only return a directory if
> PREDICATE returns 'dir-ok. This is not mentioned in the Elisp
> reference.
>
> 2. The reference suggests file-directory-p as a useful predicate and
> this would fail due to 1.
>
> 3. It's probably a good idea to mention that there are no bundled
> predicates that return dir-ok, and suggest to use a lamda like this:
> (lambda (f) (and (file-directory-p f) 'dir-ok)) as a PREDICATE.
>
>
> Here's a working example, just in case:
>
> (locate-file "Git" '("c:/Program Files/") nil (lambda (f) (and
> (file-directory-p f) 'dir-ok)))

Added a clarifiction and a similar example (though not one with w32
path) in emacs-26.

[1: f706c59093]: 2018-01-30 22:14:02 -0500
  Update manual description of locate-file (Bug#23650)
  
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=f706c59093645a6306dd907833d597884e69c0ac





reply via email to

[Prev in Thread] Current Thread [Next in Thread]