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

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

bug#66542: Fix: locate-dominating-file predicate should receive dir not


From: dalanicolai
Subject: bug#66542: Fix: locate-dominating-file predicate should receive dir not file
Date: Sat, 14 Oct 2023 17:11:18 +0200

Tags: patch

Tags: patch

The docstring of 'locate-dominating-file' mentions that its NAME argument
should be a dir, but currently it simply receives the FILE
argument. Therefore, using the function e.g. with the following predicate for NAME

(lambda (dir)
(seq-filter (apply-partially #'string-match-p "paint")
(directory-files
dir)))

to check if a directory contains a file regexp-matching 'paint', throws
an error:

(file-error "Opening directory" "Not a directory" "/home/...")

This patch simply wraps the FILE argument in the (funcall NAME FILE) with
a 'file-name-directory' thereby fixing the function.

The commit log entry could read:
FIX: ensure that locate-dominating-file predicate recives dir


In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38,
 cairo version 1.17.8) of 2023-08-09 built on
 2a02-a45d-af56-1-666c-72af-583a-b92d.fixed6.kpn.net
Repository revision: 31cef9a4eac01fff5ff4fcb89d7e2b7815e93bad
Repository branch: HEAD
System Description: Fedora Linux 38 (Workstation Edition)

Configured using:
 'configure --with-tree-sitter --with-modules --with-cairo
 --with-native-compilation --with-json --with-pgtk'

Attachment: locate-dominating-file-patch
Description: Binary data


reply via email to

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