From 05fd169c919e549a700fbca426d910f3faaba892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Thu, 23 Apr 2026 07:37:49 -0600 Subject: [PATCH] fix(emacs): syd-insert-file-name accurately label colliding paths --- .../users/msyds/emacs/lisp/syd/prelude.el | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/home/users/msyds/emacs/lisp/syd/prelude.el b/modules/home/users/msyds/emacs/lisp/syd/prelude.el index dfb7305..480e542 100755 --- a/modules/home/users/msyds/emacs/lisp/syd/prelude.el +++ b/modules/home/users/msyds/emacs/lisp/syd/prelude.el @@ -193,11 +193,13 @@ form." (cons mode (intern (concat (match-string 1 s) "-ts-mode")))) (error "Symbol `%c' is not a mode." mode)))) -(defun syd--insert-file-name-annotation (x) - (concat - " " - (propertize " " 'display `(space :align-to (- right ,(+ 1 (length x))))) - x)) +(defun syd--insert-file-name-annotation (descs) + (when descs + (let ((s (string-join descs ", "))) + (concat + " " + (propertize " " 'display `(space :align-to (- right ,(+ 1 (length s))))) + s)))) (defun syd-project-relative-file-name (file-name) (file-relative-name file-name (project-root (project-current)))) @@ -231,9 +233,12 @@ form." `(metadata (annotation-function . ,(lambda (s) - (when-let* ((desc (cdr (assoc s alts)))) + (let ((descs + (cl-loop for (p . lbl) in alts + when (equal p s) + collect lbl))) (syd--insert-file-name-annotation - desc)))))) + descs)))))) (_ (all-completions s (mapcar #'car alts) p))))))) (if (equal choice choose-a-dir) (insert (file-relative-name