From 888efb61ece6419f4c5e98110a0d9cbb73e766b2 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Sun, 16 Dec 2018 22:22:57 +0800 Subject: [PATCH] Fix: add-variable-watcher is undefined in 25. --- doom-modeline.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index 312b872..ffcbbc9 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -797,13 +797,15 @@ buffer where knowing the current project directory is important." (advice-add #'undo-tree-undo :after #'doom-modeline-update-buffer-file-state-icon) (advice-add #'undo-tree-redo :after #'doom-modeline-update-buffer-file-state-icon) (advice-add #'narrow-to-region :after #'doom-modeline-update-buffer-file-state-icon) -(advice-add #'widen :after #'doom-modeline-update-buffer-file-state-icon) +(advice-add + #'widen :after #'doom-modeline-update-buffer-file-state-icon) -(add-variable-watcher - 'buffer-read-only - (lambda (_sym val op _where) - (when (and (eq op 'set) (eq val nil)) - (doom-modeline-update-buffer-file-state-icon)))) +(when (>= emacs-major-version 26) + (add-variable-watcher + 'buffer-read-only + (lambda (_sym _val op _where) + (when (eq op 'set) + (doom-modeline-update-buffer-file-state-icon))))) (defvar-local doom-modeline--buffer-file-name nil) (defun doom-modeline-update-buffer-file-name (&rest _)