From da9fa3ced23a543f5a84fe589aa0b1f986e50a2f Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Mon, 3 Dec 2018 15:24:25 +0800 Subject: [PATCH] Fix #56: Error when launching Gnus. --- doom-modeline.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index 796ed85..cc56890 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -542,8 +542,8 @@ If DEFAULT is non-nil, set the default mode-line for all buffers." (defun doom-modeline-buffer-file-name () "Propertized variable `buffer-file-name' based on `doom-modeline-buffer-file-name-style'." - (let ((buffer-file-name (file-local-name (or (buffer-file-name (buffer-base-buffer)) ""))) - (buffer-file-truename (file-local-name (or buffer-file-truename (file-truename buffer-file-name) "")))) + (let* ((buffer-file-name (file-local-name (or (buffer-file-name (buffer-base-buffer)) ""))) + (buffer-file-truename (file-local-name (or buffer-file-truename (file-truename buffer-file-name) "")))) (propertize (pcase doom-modeline-buffer-file-name-style (`truncate-upto-project @@ -642,15 +642,15 @@ Example: (concat ;; project root parent (unless hide-project-root-parent - (propertize - (when-let (root-path-parent - (file-name-directory (directory-file-name project-root))) + (when-let (root-path-parent + (file-name-directory (directory-file-name project-root))) + (propertize (if (and truncate-project-root-parent (not (string-empty-p root-path-parent)) (not (string-equal root-path-parent "/"))) (shrink-path--dirs-internal root-path-parent t) - (abbreviate-file-name root-path-parent))) - 'face sp-props)) + (abbreviate-file-name root-path-parent)) + 'face sp-props))) ;; project (propertize (concat (file-name-nondirectory (directory-file-name project-root)) "/")