all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>, Randy Taylor <dev@rjt.dev>
Cc: 59756@debbugs.gnu.org
Subject: bug#59756: [PATCH] Use file-name-nondirectory to determine project-name
Date: Fri, 2 Dec 2022 16:37:26 +0200	[thread overview]
Message-ID: <786fefbb-d637-1580-dfbe-0b14f2aea6e9@yandex.ru> (raw)
In-Reply-To: <831qpigrcl.fsf@gnu.org>

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...





  parent reply	other threads:[~2022-12-02 14:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02  3:34 bug#59756: [PATCH] Use file-name-nondirectory to determine project-name Randy Taylor
2022-12-02  8:08 ` Eli Zaretskii
2022-12-02 12:47   ` Stefan Kangas
2022-12-02 14:37   ` Dmitry Gutov [this message]
2022-12-02 15:24 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=786fefbb-d637-1580-dfbe-0b14f2aea6e9@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=59756@debbugs.gnu.org \
    --cc=dev@rjt.dev \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.