Created
May 2, 2013 08:40
-
-
Save spacebat/5500966 to your computer and use it in GitHub Desktop.
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
| (require 'bookmark) | |
| (defvar my-doc-view-bookmark-push-p nil | |
| "Whether to push automatic doc-view bookmarks, or clobber them.") | |
| (defun my-doc-view-open-handler () | |
| (bookmark-jump (buffer-name))) | |
| (defun my-doc-view-save-handler () | |
| (if (eq major-mode 'doc-view-mode) | |
| (bookmark-set (buffer-name) my-doc-view-bookmark-push-p))) | |
| (unless (get 'bookmark-save-flag 'customized-value) | |
| (setq bookmark-save-flag 1)) | |
| (add-hook 'doc-view-mode-hook 'my-doc-view-open-handler) | |
| (add-hook 'kill-buffer-hook 'my-doc-view-save-handler) | |
| ;; ensure we've loaded the bookmarks | |
| (bookmark-maybe-load-default-file) | |
| (provide 'my-doc-view-config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment