Function: bazel--locate-file
bazel--locate-file is a natively compiled function defined in
bazel.el.
Signature
(bazel--locate-file FILENAME PATH &optional SUFFIXES)
Documentation
Variant of ‘locate-file’ that returns quoted filenames.
See Info node (elisp) Locating Files for a description of the FILENAME, PATH, and SUFFIXES arguments. Plain ‘locate-file’ doesn’t return quoted filenames, see URL ‘https://bugs.gnu.org/80820’, but this function does if the first directory in PATH is quoted.
Source Code
;; Defined in /nix/store/ws8pkszjvcad1rgzqw6wja7qxacylfhn-emacs-packages-deps/share/emacs/site-lisp/elpa/bazel-20261002.1510/bazel.el
(defun bazel--locate-file (filename path &optional suffixes)
"Variant of ‘locate-file’ that returns quoted filenames.
See Info node ‘(elisp) Locating Files’ for a description of the
FILENAME, PATH, and SUFFIXES arguments. Plain ‘locate-file’ doesn’t
return quoted filenames, see URL ‘https://bugs.gnu.org/80820’, but this
function does if the first directory in PATH is quoted."
(declare (ftype (function (string cons &optional list) (or null string))))
(cl-check-type filename string)
(cl-check-type path cons)
(cl-check-type suffixes list)
(when-let* ((result (locate-file filename path suffixes)))
(if (file-name-quoted-p (car path)) (file-name-quote result) result)))