all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Randy Taylor <dev@rjt.dev>
To: 59756@debbugs.gnu.org
Cc: dgutov@yandex.ru
Subject: bug#59756: [PATCH] Use file-name-nondirectory to determine project-name
Date: Fri, 02 Dec 2022 03:34:30 +0000	[thread overview]
Message-ID: <pTVX1m2AnkdhFahEsZnqS86UsE7L7iEb9TrBemq9rS948hvfctpXaM4f3LsZH9YQYWjpqu2bR3Wc7JoGCuhn7nWPFYkvI-UWsr5xU_rvu60=@rjt.dev> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 231 bytes --]

X-Debbugs-CC: dgutov@yandex.ru

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.

[-- Attachment #1.2: Type: text/html, Size: 1053 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-file-name-nondirectory-to-determine-project-name.patch --]
[-- Type: text/x-patch; name=0001-Use-file-name-nondirectory-to-determine-project-name.patch, Size: 989 bytes --]

From 046b1726e17e07d4800e2d3458c60942a579b67e Mon Sep 17 00:00:00 2001
From: Randy Taylor <dev@rjt.dev>
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


             reply	other threads:[~2022-12-02  3:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02  3:34 Randy Taylor [this message]
2022-12-02  8:08 ` bug#59756: [PATCH] Use file-name-nondirectory to determine project-name Eli Zaretskii
2022-12-02 12:47   ` Stefan Kangas
2022-12-02 14:37   ` Dmitry Gutov
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='pTVX1m2AnkdhFahEsZnqS86UsE7L7iEb9TrBemq9rS948hvfctpXaM4f3LsZH9YQYWjpqu2bR3Wc7JoGCuhn7nWPFYkvI-UWsr5xU_rvu60=@rjt.dev' \
    --to=dev@rjt.dev \
    --cc=59756@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /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.