all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: emacs-devel@gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: cl-assertion error in doc-view
Date: Wed, 19 Sep 2012 19:55:49 +0200	[thread overview]
Message-ID: <87obl1yk0q.fsf@thinkpad.tsdh.de> (raw)

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	other threads:[~2012-09-19 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19 17:55 Tassilo Horn [this message]
2012-09-20 17:25 ` cl-assertion error in doc-view martin rudalics
2012-09-20 19:54   ` Tassilo Horn
2012-09-20 21:10   ` Stefan Monnier
2012-09-20 22:24     ` martin rudalics
2012-09-21  1:12       ` Stefan Monnier
2012-09-21  7:14         ` Tassilo Horn
2012-09-21 12:59           ` Stefan Monnier
2012-09-27  3:17 ` Stefan Monnier
2012-09-27 18:17   ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87obl1yk0q.fsf@thinkpad.tsdh.de \
    --to=tsdh@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.