From 75fe56293a07c1d260c948116cd1585af3d64f2b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 7 Jul 2025 14:56:32 -0700 Subject: oni-core: Add color to the unique part of a buffer name This only applies to buffer lists like ‘switch-buffer’, ‘ibuffer’, and the like, not to the mode-line. This should help make it easier to distinguish which parts are special when more than one buffer with the same name is open. --- oni-core.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/oni-core.el b/oni-core.el index 34725b6..c94bb6b 100644 --- a/oni-core.el +++ b/oni-core.el @@ -551,5 +551,18 @@ which normally have their errors suppressed." ;; removed along with the other whitespace. (setq cycle-spacing-actions '((just-one-space -) (delete-all-space -) restore)) +;;; Colorize the unique part of buffers + +(defun oni-core-colored-post-forward-angle-brackets (base extra-strings) + "Return BASE with the second part colorized. +This does the same thing as setting ‘uniquify-buffer-name-style' to +‘post-forward-angle-brackets', except that it colorizes the unique part +of the buffer name." + (concat base + (propertize (concat "<" (mapconcat #'identity extra-strings "/") ">") + 'face '(:foreground "#72f1f1")))) + +(setq uniquify-buffer-name-style 'oni-core-colored-post-forward-angle-brackets) + (provide 'oni-core) ;;; oni-core.el ends here -- cgit v1.3-2-g0d8e