Created
January 25, 2014 02:22
-
-
Save suhailshergill/8610821 to your computer and use it in GitHub Desktop.
emacs: have doc-view-open-text remember correct page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defadvice doc-view-open-text (around | |
su/advice/doc-view/doc-view-open-text/around/goto-page | |
last a c pre) | |
"grab the page when in doc-view mode and ensure that doc-view-open-text | |
opens the correct page" | |
(let ((su/dv/page (doc-view-current-page)) | |
(su/dv/text-buffer-name (concat "Text contents of " (buffer-name)))) | |
ad-do-it | |
(with-current-buffer su/dv/text-buffer-name | |
(re-search-forward "" nil t (1- su/dv/page)) | |
(recenter-top-bottom 0)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment