1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-08 15:35:02 +00:00

2008-01-29 Tassilo Horn <tassilo@member.fsf.org>

* doc-view.el (doc-view-mode): Use facilities of
	image-mode to restore [vh]scroll when switching buffers.
This commit is contained in:
Tassilo Horn 2008-01-29 13:50:35 +00:00
parent 36e1c289c7
commit 6f70aa334f
2 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,18 @@
2008-01-29 Tassilo Horn <tassilo@member.fsf.org>
* doc-view.el (doc-view-mode): Use facilities below to
restore [vh]scroll when switching buffers.
* image-mode.el (image-mode-current-vscroll)
(image-mode-current-hscroll): New variables.
(image-set-window-hscroll, image-set-window-vscroll): New
functions.
(image-forward-hscroll, image-next-line, image-bol, image-eol)
(image-bob, image-eob): Use them.
(image-reset-current-vhscroll): New function.
(image-mode): Make new variables buffer-local and reset [vh]scroll
on window configuration changes.
2008-01-27 Nick Roberts <nickrob@snap.net.nz>
* progmodes/gdb-ui.el (gdb-create-define-alist): Don't call

View File

@ -987,6 +987,15 @@ toggle between displaying the document or editing it as text."
(add-hook 'change-major-mode-hook
(lambda () (delete-overlay doc-view-current-overlay))
nil t)
;; Keep track of [vh]scroll when switching buffers
(set (make-local-variable 'image-mode-current-hscroll)
(window-hscroll (selected-window)))
(set (make-local-variable 'image-mode-current-vscroll)
(window-vscroll (selected-window)))
(add-hook 'window-configuration-change-hook
'image-reset-current-vhscroll nil t)
(set (make-local-variable 'mode-line-position)
'(" P" (:eval (number-to-string doc-view-current-page))
"/" (:eval (number-to-string (length doc-view-current-files)))))