From: Tassilo Horn Date: Thu, 20 Sep 2012 19:53:40 +0000 (+0200) Subject: * doc-view.el (doc-view-display): Better fix for the cl-assertion X-Git-Tag: emacs-24.2.90~269^2~8 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c9e452d3a1e611ccd66a0c0030ef8e12d73b27c9;p=emacs.git * doc-view.el (doc-view-display): Better fix for the cl-assertion error. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fd7bc3defec..ca544b023e6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-20 Tassilo Horn + + * doc-view.el (doc-view-display): Better fix for the cl-assertion + error. + 2012-09-20 Stefan Merten * rst.el: Integrate support for `imenu' and `which-function'. diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 65bf26e5eca..158d447a1d4 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1169,15 +1169,16 @@ Predicate for sorting `doc-view-current-files'." If FORCE is non-nil, start viewing even if the document does not have the page we want to view." (with-current-buffer buffer - (let ((prev-pages doc-view-current-files)) + (let ((prev-pages doc-view-current-files) + (windows (get-buffer-window-list buffer nil t))) (setq doc-view-current-files (sort (directory-files (doc-view-current-cache-dir) t "page-[0-9]+\\.png" t) 'doc-view-sort)) - (dolist (win (or (get-buffer-window-list buffer nil t) - (list (let ((w (selected-window))) - (set-window-buffer w buffer) - w)))) + (unless windows + (switch-to-buffer buffer) + (setq windows (get-buffer-window-list buffer nil t))) + (dolist (win windows) (let* ((page (doc-view-current-page win)) (pagefile (expand-file-name (format "page-%d.png" page) (doc-view-current-cache-dir))))