1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-28 10:56:36 +00:00

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).
This commit is contained in:
Lars Ingebrigtsen 2019-10-03 16:54:44 +02:00
parent 44dfa7a834
commit c1c9af312e

View File

@ -1505,7 +1505,8 @@ For now these keys are useful:
(interactive)
(if doc-view--current-converter-processes
(message "DocView: please wait till conversion finished.")
(let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir))))
(let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir)))
(page (doc-view-current-page)))
(if (file-readable-p txt)
(let ((inhibit-read-only t)
(buffer-undo-list t)
@ -1521,6 +1522,10 @@ For now these keys are useful:
(setq-local doc-view--buffer-file-name dv-bfn)
(set-buffer-modified-p nil)
(doc-view-minor-mode)
(goto-char (point-min))
;; Put point at the start of the page the user what
;; reading. Pages are separated by Control-L characters.
(re-search-forward page-delimiter nil t (1- page))
(add-hook 'write-file-functions
(lambda ()
;; FIXME: If the user changes major mode and then