summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron L. Zeng <azeng@janestreet.com>2025-12-01 18:17:14 -0500
committerJoão Távora <joaotavora@gmail.com>2026-01-10 11:29:37 +0000
commitdfd1ff57e010a12ba1e6a33fb2dd751981487750 (patch)
tree37f6b42074474985bedf25df00449d0a47194712
parentda34d030e6d01db2bba45b30080204b23a714c9f (diff)
Close #47: Try project-name instead of root directory basename
project-name's default implementation is equivalent to the previous code, so no behavior change is expected unless the project type overrides the project-name method. * breadcrumb.el (bc--project-crumbs-1): Tweak.
-rw-r--r--breadcrumb.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/breadcrumb.el b/breadcrumb.el
index dc0bbc0..433cd32 100644
--- a/breadcrumb.el
+++ b/breadcrumb.el
@@ -346,11 +346,13 @@ to ROOT."
(defun bc--project-crumbs-1 (bfn)
"Helper for `breadcrumb-project-crumbs'.
-Given BFN, the `buffer-file-name', produce a a list of
+Given BFN, the `buffer-file-name', produce a list of
propertized crumbs."
(cl-loop
with project = (project-current)
with root = (if project (project-root project) default-directory)
+ with pname = (if project (project-name project)
+ (file-name-nondirectory (directory-file-name root)))
with relname = (file-relative-name (or bfn default-directory)
root)
for (s . more) on (split-string relname "/")
@@ -360,7 +362,7 @@ propertized crumbs."
finally
(cl-return
(if root
- (cons (propertize (file-name-nondirectory (directory-file-name root))
+ (cons (propertize pname
'bc-dont-shorten t
'face 'bc-project-base-face)
retval)