Allow <count>G in doc-view to go to page

This commit is contained in:
Eivind Fonn 2016-01-26 16:36:31 +01:00 committed by syl20bnr
parent b3b0ecb399
commit 4b004951b2

View file

@ -488,7 +488,7 @@
"/" 'spacemacs/doc-view-search-new-query
"?" 'spacemacs/doc-view-search-new-query-backward
"gg" 'doc-view-first-page
"G" 'doc-view-last-page
"G" 'spacemacs/doc-view-goto-page
"gt" 'doc-view-goto-page
"h" 'doc-view-previous-page
"j" 'doc-view-next-line-or-next-page
@ -512,6 +512,14 @@
(interactive)
(doc-view-search 'newquery t))
(defun spacemacs/doc-view-goto-page (&optional count)
(interactive (list
(when current-prefix-arg
(prefix-numeric-value current-prefix-arg))))
(if (null count)
(doc-view-last-page)
(doc-view-goto-page count)))
;; fixed a weird issue where toggling display does not
;; swtich to text mode
(defadvice doc-view-toggle-display