From 643d6dd7047b07f081482ffa3cddf22de42a5a9c Mon Sep 17 00:00:00 2001 From: TEC Date: Wed, 14 Sep 2022 19:42:45 +0800 Subject: [PATCH] Make custom frame-title-format less error-prone --- config.org | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config.org b/config.org index bcea036..01efef0 100644 --- a/config.org +++ b/config.org @@ -1936,13 +1936,14 @@ I'd like to have just the buffer name, then if applicable the project folder (setq frame-title-format '("" (:eval - (if (s-contains-p org-roam-directory (or buffer-file-name "")) + (if (string-match-p (regexp-quote (or (bound-and-true-p org-roam-directory) "\u0000")) + (or buffer-file-name "")) (replace-regexp-in-string ".*/[0-9]*-?" "☰ " - (subst-char-in-string ?_ ? buffer-file-name)) + (subst-char-in-string ?_ ?\s buffer-file-name)) "%b")) (:eval - (let ((project-name (projectile-project-name))) + (when-let ((project-name (and (featurep 'projectile) (projectile-project-name)))) (unless (string= "-" project-name) (format (if (buffer-modified-p) " ◉ %s" "  ●  %s") project-name)))))) #+end_src