From 46427789aa9a015d681450f4c312f30d91c29149 Mon Sep 17 00:00:00 2001 From: Blake Romero Date: Fri, 10 Oct 2025 23:48:46 +0100 Subject: Add icons based on read-only status --- modally.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'modally.el') diff --git a/modally.el b/modally.el index d029ee7..d673c82 100644 --- a/modally.el +++ b/modally.el @@ -34,15 +34,16 @@ (defun modally--buffer-name () "Return a propertized buffer name string." (let* ((buffer-face (cond - ((buffer-modified-p) 'modally-buffer-modified) - (buffer-read-only 'modally-buffer-readonly) - ('modally-buffer))) - (buffer-name (if buffer-file-name - (if (string-match "^\\(/home/[^/]+\\)\\(.+\\)" - buffer-file-name) - (concat "~" (match-string 2 buffer-file-name)) - buffer-file-name) - (buffer-name (current-buffer)))) + ((buffer-modified-p) 'modally-buffer-modified) + (buffer-read-only 'modally-buffer-readonly) + ('modally-buffer))) + (buffer-name (concat (if buffer-read-only "🔒 " "✏️ ") + (if buffer-file-name + (if (string-match "^\\(/home/[^/]+\\)\\(.+\\)" + buffer-file-name) + (concat "~" (match-string 2 buffer-file-name)) + buffer-file-name) + (buffer-name (current-buffer))))) (spath (string-split buffer-name "/"))) ;; Format -- cgit