emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cl-assertion error in doc-view


From: Tassilo Horn
Subject: cl-assertion error in doc-view
Date: Wed, 19 Sep 2012 19:55:49 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux)

Hi Stefan & all,

I've just checked in that new slice by bounding box feature for
doc-view, and additionally this change in `doc-view-display' I'm not to
certain it's TRT.

--8<---------------cut here---------------start------------->8---
@@ -1095,7 +1175,9 @@
                                    "page-[0-9]+\\.png" t)
                   'doc-view-sort))
       (dolist (win (or (get-buffer-window-list buffer nil t)
-                      (list (selected-window))))
+                      (list (let ((w (selected-window)))
+                              (set-window-buffer w buffer)
+                              w))))
        (let* ((page (doc-view-current-page win))
               (pagefile (expand-file-name (format "page-%d.png" page)
                                           (doc-view-current-cache-dir))))
@@ -1103,8 +1185,8 @@
                    (and (not (member pagefile prev-pages))
                         (member pagefile doc-view-current-files)))
            (with-selected-window win
-                                 (cl-assert (eq (current-buffer) buffer))
-                                 (doc-view-goto-page page))))))))
+             (cl-assert (eq (current-buffer) buffer) t)
+             (doc-view-goto-page page))))))))
--8<---------------cut here---------------end--------------->8---

Before that change, when I find some foo.pdf file with emacs -Q, the
cl-assert triggers because the foo.pdf buffer isn't already displayed
thus `get-buffer-window-list' returns nil, and `selected-window' returns
the window I'm in when doing the `C-x C-f foo.pdf'.

Is the change sensible?  At least, it fixes the bug, but the multiple
windows on the same doc stuff is yours, so feel free to correct it as
seems fit.  Maybe the bug is somewhere else, though, at least it
suprises me that when finding a file and the major mode function runs
the buffer isn't already displayed.  I think it used to be different...

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]