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

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

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


From: Dmitry Gutov
Subject: bug#59756: [PATCH] Use file-name-nondirectory to determine project-name
Date: Fri, 2 Dec 2022 16:37:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 02/12/2022 10:08, Eli Zaretskii wrote:
Cc: dgutov@yandex.ru
Date: Fri, 02 Dec 2022 03:34:30 +0000
From: Randy Taylor <dev@rjt.dev>

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.

Why do we want to support such project names?

The bug's description is not very good.

The goal of the code in question is to produce an automatic version of the project name from its root directory, allowing individual project backends to override that logic.

This fix is an update for the same (logic to produce the default name), restoring what I'm sure was the original intent. The directories just don't often have extensions, so it passed by the initial testing.

I could also name my project /foo/bar/baz, and defeat file-name-nondirectory
as well.  Where does it end?

This is not about the user naming a project something.

ELISP> (file-name-nondirectory (directory-file-name "/foo/bar/baz/"))
"baz"

This is correct.

This custom name (e.g. set through project-vc-name) does not pass through this conversion. You can use whatever special characters you want, why not? Newlines might break some UI, but if the user wants that...





reply via email to

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