comparison lisp/doc-view.el @ 87850:dd673d4bceda

(doc-view-goto-page): Don't move point any more, now that the hscroll behavior was fixed. (doc-view-mode): Disable auto-hscroll-mode.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 19 Jan 2008 05:34:29 +0000
parents 3a98637489f5
children fd7dd85405fc
comparison
equal deleted inserted replaced
87849:8f7e97005eef 87850:dd673d4bceda
97 ;; 97 ;;
98 ;; and modify them to your needs. 98 ;; and modify them to your needs.
99 99
100 ;;; Todo: 100 ;;; Todo:
101 101
102 ;; - share more code with image-mode again.
102 ;; - better menu. 103 ;; - better menu.
103 ;; - Bind slicing to a drag event. 104 ;; - Bind slicing to a drag event.
104 ;; - doc-view-fit-doc-to-window and doc-view-fit-window-to-doc. 105 ;; - doc-view-fit-doc-to-window and doc-view-fit-window-to-doc.
105 ;; - zoom the region around the cursor (like xdvi). 106 ;; - zoom the region around the cursor (like xdvi).
106 ;; - get rid of the silly arrow in the fringe. 107 ;; - get rid of the silly arrow in the fringe.
354 (setq contexts (concat contexts " - \"" m "\"\n"))) 355 (setq contexts (concat contexts " - \"" m "\"\n")))
355 contexts))))) 356 contexts)))))
356 ;; Update the buffer 357 ;; Update the buffer
357 (doc-view-insert-image (nth (1- page) doc-view-current-files) 358 (doc-view-insert-image (nth (1- page) doc-view-current-files)
358 :pointer 'arrow) 359 :pointer 'arrow)
359 (overlay-put doc-view-current-overlay 'help-echo doc-view-current-info) 360 (overlay-put doc-view-current-overlay 'help-echo doc-view-current-info)))
360 (goto-char (point-min))
361 ;; This seems to be needed for set-window-hscroll (in
362 ;; image-forward-hscroll) to do something useful, I don't have time to
363 ;; debug this now. :-( --Stef
364 (forward-char)))
365 361
366 (defun doc-view-next-page (&optional arg) 362 (defun doc-view-next-page (&optional arg)
367 "Browse ARG pages forward." 363 "Browse ARG pages forward."
368 (interactive "p") 364 (interactive "p")
369 (doc-view-goto-page (+ doc-view-current-page (or arg 1)))) 365 (doc-view-goto-page (+ doc-view-current-page (or arg 1))))
992 (lambda () (delete-overlay doc-view-current-overlay)) 988 (lambda () (delete-overlay doc-view-current-overlay))
993 nil t) 989 nil t)
994 (set (make-local-variable 'mode-line-position) 990 (set (make-local-variable 'mode-line-position)
995 '(" P" (:eval (number-to-string doc-view-current-page)) 991 '(" P" (:eval (number-to-string doc-view-current-page))
996 "/" (:eval (number-to-string (length doc-view-current-files))))) 992 "/" (:eval (number-to-string (length doc-view-current-files)))))
993 ;; Don't scroll unless the user specifically asked for it.
994 (set (make-local-variable 'auto-hscroll-mode) nil)
997 (set (make-local-variable 'cursor-type) nil) 995 (set (make-local-variable 'cursor-type) nil)
998 (use-local-map doc-view-mode-map) 996 (use-local-map doc-view-mode-map)
999 (set (make-local-variable 'after-revert-hook) 'doc-view-reconvert-doc) 997 (set (make-local-variable 'after-revert-hook) 'doc-view-reconvert-doc)
1000 (set (make-local-variable 'bookmark-make-cell-function) 998 (set (make-local-variable 'bookmark-make-cell-function)
1001 'doc-view-bookmark-make-cell) 999 'doc-view-bookmark-make-cell)