From 2818d7faa3b05ea0e24cb65491c81af9da72a4c9 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Sun, 12 May 2019 01:02:05 +0800 Subject: [PATCH] Improve pdf mode-line. --- doom-modeline-segments.el | 7 ++----- doom-modeline.el | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 6a3fe7f..98e585e 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -1884,15 +1884,12 @@ mouse-1: Toggle Debug on Quit" (format " P%d/%d " (eval `(pdf-view-current-page)) (pdf-cache-number-of-pages)) - 'face (if (doom-modeline--active) - 'mode-line - 'mode-line-inactive)))) + 'face (if (doom-modeline--active) 'mode-line 'mode-line-inactive)))) (add-hook 'pdf-view-change-page-hook #'doom-modeline-update-pdf-pages) (doom-modeline-def-segment pdf-pages "Display PDF pages." - (when (eq major-mode 'pdf-view-mode) - doom-modeline--pdf-pages)) + doom-modeline--pdf-pages) ;; diff --git a/doom-modeline.el b/doom-modeline.el index dd155e9..2bca677 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -208,7 +208,7 @@ If DEFAULT is non-nil, set the default mode-line for all buffers." (add-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline) (add-hook 'image-mode-hook #'doom-modeline-set-media-modeline) (add-hook 'circe-mode-hook #'doom-modeline-set-special-modeline) - (add-hook 'pdf-tools-enabled-hook #'doom-modeline-set-pdf-modeline) + (add-hook 'pdf-view-mode-hook #'doom-modeline-set-pdf-modeline) (add-hook 'paradox-menu-mode-hook #'doom-modeline-set-package-modeline) ;; Add advice (advice-add #'helm-display-mode-line :override #'doom-modeline-set-helm-modeline)) @@ -221,7 +221,7 @@ If DEFAULT is non-nil, set the default mode-line for all buffers." (remove-hook 'dashboard-mode-hook #'doom-modeline-set-project-modeline) (remove-hook 'image-mode-hook #'doom-modeline-set-media-modeline) (remove-hook 'circe-mode-hook #'doom-modeline-set-special-modeline) - (remove-hook 'pdf-tools-enabled-hook #'doom-modeline-set-pdf-modeline) + (remove-hook 'pdf-view-mode-hook #'doom-modeline-set-pdf-modeline) (remove-hook 'paradox-menu-mode-hook #'doom-modeline-set-package-modeline) ;; Remove advices (advice-remove #'helm-display-mode-line #'doom-modeline-set-helm-modeline))))