aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-10-03 16:54:44 +0200
committerLars Ingebrigtsen2019-10-03 16:54:50 +0200
commitc1c9af312ed32f9e006452eef56ecabf6438cae9 (patch)
tree36a30acbdf023e8f026155467c6dae7903a022e6
parent44dfa7a834c11897fd64dba7b15cb0dcce0af980 (diff)
downloademacs-c1c9af312ed32f9e006452eef56ecabf6438cae9.tar.gz
emacs-c1c9af312ed32f9e006452eef56ecabf6438cae9.zip
In doc-view, keep point on the equivalent page in the text version
* lisp/doc-view.el (doc-view-open-text): After opening the text version, put point on the page the user was reading (bug#16541).
-rw-r--r--lisp/doc-view.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index f75421e7b5c..1f864f8a457 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -1505,7 +1505,8 @@ For now these keys are useful:
1505 (interactive) 1505 (interactive)
1506 (if doc-view--current-converter-processes 1506 (if doc-view--current-converter-processes
1507 (message "DocView: please wait till conversion finished.") 1507 (message "DocView: please wait till conversion finished.")
1508 (let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir)))) 1508 (let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir)))
1509 (page (doc-view-current-page)))
1509 (if (file-readable-p txt) 1510 (if (file-readable-p txt)
1510 (let ((inhibit-read-only t) 1511 (let ((inhibit-read-only t)
1511 (buffer-undo-list t) 1512 (buffer-undo-list t)
@@ -1521,6 +1522,10 @@ For now these keys are useful:
1521 (setq-local doc-view--buffer-file-name dv-bfn) 1522 (setq-local doc-view--buffer-file-name dv-bfn)
1522 (set-buffer-modified-p nil) 1523 (set-buffer-modified-p nil)
1523 (doc-view-minor-mode) 1524 (doc-view-minor-mode)
1525 (goto-char (point-min))
1526 ;; Put point at the start of the page the user what
1527 ;; reading. Pages are separated by Control-L characters.
1528 (re-search-forward page-delimiter nil t (1- page))
1524 (add-hook 'write-file-functions 1529 (add-hook 'write-file-functions
1525 (lambda () 1530 (lambda ()
1526 ;; FIXME: If the user changes major mode and then 1531 ;; FIXME: If the user changes major mode and then