changeset 94443:f41f8f74c3cb

(doc-view-new-window-function): Avoid using WINDOW argument to get-char-property, in case the current buffer hasn't been assigned to that window yet. (doc-view-display): Default to selected window if the current buffer hasn't been assigned to a window yet.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 28 Apr 2008 23:49:02 +0000
parents 245b6ba7c339
children 606c1d881bf0
files lisp/doc-view.el
diffstat 1 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/doc-view.el	Mon Apr 28 23:48:35 2008 +0000
+++ b/lisp/doc-view.el	Mon Apr 28 23:49:02 2008 +0000
@@ -230,7 +230,7 @@
   (let ((ol (image-mode-window-get 'overlay winprops)))
     (if ol
         (setq ol (copy-overlay ol))
-      (assert (not (get-char-property (point-min) 'display (car winprops))))
+      (assert (not (get-char-property (point-min) 'display)))
       (setq ol (make-overlay (point-min) (point-max) nil t))
       (overlay-put ol 'doc-view t))
     (overlay-put ol 'window (car winprops))
@@ -845,16 +845,17 @@
             (sort (directory-files (doc-view-current-cache-dir) t
                                    "page-[0-9]+\\.png" t)
                   'doc-view-sort))
-      (dolist (win (get-buffer-window-list buffer nil t))
-        (let* ((page (doc-view-current-page win))
-               (pagefile (expand-file-name (format "page-%d.png" page)
-                                             (doc-view-current-cache-dir))))
-          (when (or force
-                    (and (not (member pagefile prev-pages))
-                         (member pagefile doc-view-current-files)))
-            (with-selected-window win
-              (assert (eq (current-buffer) buffer))
-              (doc-view-goto-page page))))))))
+      (dolist (win (or (get-buffer-window-list buffer nil t)
+		       (list (selected-window))))
+	(let* ((page (doc-view-current-page win))
+	       (pagefile (expand-file-name (format "page-%d.png" page)
+					   (doc-view-current-cache-dir))))
+	  (when (or force
+		    (and (not (member pagefile prev-pages))
+			 (member pagefile doc-view-current-files)))
+	    (with-selected-window win
+	      (assert (eq (current-buffer) buffer))
+	      (doc-view-goto-page page))))))))
 
 (defun doc-view-buffer-message ()
   ;; Only show this message initially, not when refreshing the buffer (in which