lang/pdf: fix compatibility with +new modeline

This commit is contained in:
Henrik Lissner 2018-07-25 15:37:24 +02:00
parent 9abafcf74a
commit df233eb1a9
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 16 additions and 6 deletions

View file

@ -4,6 +4,17 @@
"Current and total page indicator for PDF documents." "Current and total page indicator for PDF documents."
(format "P %d/%d" (pdf-view-current-page) (pdf-cache-number-of-pages))) (format "P %d/%d" (pdf-view-current-page) (pdf-cache-number-of-pages)))
(def-modeline! pdf-tools-modeline (if (featurep! :ui doom-modeline +new)
(bar matches " " buffer-info +pdf-pages) (def-modeline-format! '+pdf
(major-mode vcs)) '(+mode-line-bar " " +mode-line-buffer-id " " +pdf-pages)
'(+mode-line-major-mode +mode-line-vcs))
(def-modeline! '+pdf
'(bar matches " " buffer-info +pdf-pages)
'(major-mode vcs)))
(defun +pdf|init-modeline ()
(funcall (if (featurep! :ui doom-modeline +new)
#'set-modeline!
#'doom-set-modeline)
'+pdf))
(add-hook 'pdf-tools-enabled-hook #'+pdf|init-modeline)

View file

@ -31,8 +31,7 @@
(add-hook! 'pdf-view-mode-hook (cua-mode 0)) (add-hook! 'pdf-view-mode-hook (cua-mode 0))
;; Custom modeline that removes useless info and adds page numbers ;; Custom modeline that removes useless info and adds page numbers
(when (featurep! :ui doom-modeline) (when (featurep! :ui doom-modeline)
(load! "+modeline") (load! "+modeline"))
(add-hook! 'pdf-tools-enabled-hook (doom-set-modeline 'pdf-tools-modeline)))
;; Handle PDF-tools related popups better ;; Handle PDF-tools related popups better
(set-popup-rule! "^\\*Outline*" :side 'right :size 40 :select nil) (set-popup-rule! "^\\*Outline*" :side 'right :size 40 :select nil)
;; TODO: Add additional important windows that should be handled differently ;; TODO: Add additional important windows that should be handled differently