summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-05-02 14:16:44 -0400
committerDavid Robillard <d@drobilla.net>2016-05-02 14:16:44 -0400
commit2f7ffcb1dccdb4a33841b7a3532be2c8db820038 (patch)
treeb6463238dbcc5744b7cb1a60be7c74bb3462d864
parent31bf9cd59f24fa1f42c56473a5a67751a05bf465 (diff)
downloaddotfiles-2f7ffcb1dccdb4a33841b7a3532be2c8db820038.tar.gz
dotfiles-2f7ffcb1dccdb4a33841b7a3532be2c8db820038.tar.bz2
dotfiles-2f7ffcb1dccdb4a33841b7a3532be2c8db820038.zip
Show page number/count in modeline for PDFs
-rw-r--r--emacs.d/init.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/emacs.d/init.el b/emacs.d/init.el
index d450177..5d6488b 100644
--- a/emacs.d/init.el
+++ b/emacs.d/init.el
@@ -319,9 +319,21 @@
;; PDF
+(pdf-tools-install)
+
(add-hook 'doc-view-mode-hook 'auto-revert-mode)
(add-hook 'pdf-view-mode-hook 'auto-revert-mode)
+(spaceline-define-segment line-column
+ "The current line and column numbers."
+ (if (eq major-mode 'pdf-view-mode)
+ ;; Show page number and count for PDF documents
+ (concat (number-to-string (pdf-view-current-page))
+ "/"
+ (number-to-string (pdf-cache-number-of-pages)))
+ mode-line-position
+ "%l:%2c"))
+
;; Associations
(add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode))