From a75f6f2ec8d9792edabae8fb92e00b6c9a83059f Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Thu, 15 Nov 2018 03:40:21 +0800 Subject: [PATCH] Update buffer file name after renaming a buffer. --- doom-modeline.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doom-modeline.el b/doom-modeline.el index ae4a0fa..80fe898 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -610,7 +610,7 @@ buffer where knowing the current project directory is important." ;; (defvar-local doom-modeline-buffer-file-name nil) -(defun doom-modeline-update-buffer-file-name () +(defun doom-modeline-update-buffer-file-name (&rest _) "Propertized variable `buffer-file-name' based on `doom-modeline-buffer-file-name-style'." (setq doom-modeline-buffer-file-name ;; Show buffer name if it doesn't equal the file name. @@ -628,6 +628,7 @@ buffer where knowing the current project directory is important." (add-hook 'after-revert-hook #'doom-modeline-update-buffer-file-name) (add-hook 'after-save-hook #'doom-modeline-update-buffer-file-name) (add-hook 'git-timemachine-mode-hook #'doom-modeline-update-buffer-file-name) +(advice-add #'rename-buffer :after #'doom-modeline-update-buffer-file-name) (doom-modeline-def-segment buffer-info "Combined information about the current buffer, including the current working