* doc-view.el (doc-view-display): Better fix for the cl-assertion

error.
This commit is contained in:
Tassilo Horn 2012-09-20 21:53:40 +02:00
parent ee97deeedd
commit c9e452d3a1
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2012-09-20 Tassilo Horn <tsdh@gnu.org>
* doc-view.el (doc-view-display): Better fix for the cl-assertion
error.
2012-09-20 Stefan Merten <smerten@oekonux.de>
* rst.el: Integrate support for `imenu' and `which-function'.

View file

@ -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))))