diff options
| author | Tassilo Horn | 2008-01-29 13:50:35 +0000 |
|---|---|---|
| committer | Tassilo Horn | 2008-01-29 13:50:35 +0000 |
| commit | 6f70aa334f6f388d2ea86e8e14747f6bb11e6795 (patch) | |
| tree | 21bfad09673ea20c7d5f998408cd1acae46d1a3d | |
| parent | 36e1c289c7d381817583d5b06e013550f56b0b8b (diff) | |
| download | emacs-6f70aa334f6f388d2ea86e8e14747f6bb11e6795.tar.gz emacs-6f70aa334f6f388d2ea86e8e14747f6bb11e6795.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/doc-view.el | 9 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 51a033602ff..5c68efb5298 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2008-01-29 Tassilo Horn <tassilo@member.fsf.org> | ||
| 2 | |||
| 3 | * doc-view.el (doc-view-mode): Use facilities below to | ||
| 4 | restore [vh]scroll when switching buffers. | ||
| 5 | |||
| 6 | * image-mode.el (image-mode-current-vscroll) | ||
| 7 | (image-mode-current-hscroll): New variables. | ||
| 8 | (image-set-window-hscroll, image-set-window-vscroll): New | ||
| 9 | functions. | ||
| 10 | (image-forward-hscroll, image-next-line, image-bol, image-eol) | ||
| 11 | (image-bob, image-eob): Use them. | ||
| 12 | (image-reset-current-vhscroll): New function. | ||
| 13 | (image-mode): Make new variables buffer-local and reset [vh]scroll | ||
| 14 | on window configuration changes. | ||
| 15 | |||
| 1 | 2008-01-27 Nick Roberts <nickrob@snap.net.nz> | 16 | 2008-01-27 Nick Roberts <nickrob@snap.net.nz> |
| 2 | 17 | ||
| 3 | * progmodes/gdb-ui.el (gdb-create-define-alist): Don't call | 18 | * progmodes/gdb-ui.el (gdb-create-define-alist): Don't call |
diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 034eace3dfb..047785e844c 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el | |||
| @@ -987,6 +987,15 @@ toggle between displaying the document or editing it as text." | |||
| 987 | (add-hook 'change-major-mode-hook | 987 | (add-hook 'change-major-mode-hook |
| 988 | (lambda () (delete-overlay doc-view-current-overlay)) | 988 | (lambda () (delete-overlay doc-view-current-overlay)) |
| 989 | nil t) | 989 | nil t) |
| 990 | |||
| 991 | ;; Keep track of [vh]scroll when switching buffers | ||
| 992 | (set (make-local-variable 'image-mode-current-hscroll) | ||
| 993 | (window-hscroll (selected-window))) | ||
| 994 | (set (make-local-variable 'image-mode-current-vscroll) | ||
| 995 | (window-vscroll (selected-window))) | ||
| 996 | (add-hook 'window-configuration-change-hook | ||
| 997 | 'image-reset-current-vhscroll nil t) | ||
| 998 | |||
| 990 | (set (make-local-variable 'mode-line-position) | 999 | (set (make-local-variable 'mode-line-position) |
| 991 | '(" P" (:eval (number-to-string doc-view-current-page)) | 1000 | '(" P" (:eval (number-to-string doc-view-current-page)) |
| 992 | "/" (:eval (number-to-string (length doc-view-current-files))))) | 1001 | "/" (:eval (number-to-string (length doc-view-current-files))))) |