Subject: bug#59756: [PATCH] Use file-name-nondirectory to determine project-name

From: Randy Taylor <[email-masked]>
Date: Fri, 02 Dec 2022 03:34:30 +0000

X-Debbugs-CC: [email-masked]

If a project is named something like ".emacs.d", file-name-base will return ".emacs" instead of ".emacs.d" as expected (or at least as I expect it).

Therefore, we use file-name-nondirectory instead.

From 046b1726e17e07d4800e2d3458c60942a579b67e Mon Sep 17 00:00:00 2001
From: Randy Taylor <[email-masked]>
Date: Thu, 1 Dec 2022 22:12:07 -0500
Subject: [PATCH] Use file-name-nondirectory to determine project-name

* lisp/progmodes/project.el (project-name): Use file-name-nondirectory
instead of file-name-base.
---
 lisp/progmodes/project.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 3f4a5fb04bc..4eed599d86c 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -278,7 +278,7 @@ project-external-roots
 (cl-defgeneric project-name (project)
   "A human-readable name for the project.
 Nominally unique, but not enforced."
-  (file-name-base (directory-file-name (project-root project))))
+  (file-name-nondirectory (directory-file-name (project-root project))))
 
 (cl-defgeneric project-ignores (_project _dir)
   "Return the list of glob patterns to ignore inside DIR.
-- 
2.38.1