branch: externals/compat commit 6445814abdbb40901ec2f382d6613573f0d9f5cc Author: Philip Kaludercic <phil...@posteo.net> Commit: Philip Kaludercic <phil...@posteo.net>
Use compatibility functions in file-name-with-extension definition --- compat-28.1.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compat-28.1.el b/compat-28.1.el index 489188e..e2c6935 100644 --- a/compat-28.1.el +++ b/compat-28.1.el @@ -338,8 +338,6 @@ as the new values of the bound variables in the recursive invocation." ;;;; Defined in files.el -(declare-function string-trim-left nil) -(declare-function directory-name-p nil) (compat-defun file-name-with-extension (filename extension) "Set the EXTENSION of a FILENAME. The extension (in a file name) is the part that begins with the last \".\". @@ -351,13 +349,13 @@ Errors if the FILENAME or EXTENSION are empty, or if the given FILENAME has the format of a directory. See also `file-name-sans-extension'." - (let ((extn (string-trim-left extension "[.]"))) + (let ((extn (compat--string-trim-left extension "[.]"))) (cond ((string= filename "") (error "Empty filename")) ((string= extn "") (error "Malformed extension: %s" extension)) - ((directory-name-p filename) + ((compat--directory-name-p filename) (error "Filename is a directory: %s" filename)) (t (concat (file-name-sans-extension filename) "." extn)))))