GNU bug report logs - #16090
24.3.50; [PATCH] error when jumping to a doc-view bookmark

Previous Next

Package: emacs;

Reported by: Andreas Politz <politza <at> hochschule-trier.de>

Date: Sun, 8 Dec 2013 16:56:01 UTC

Severity: normal

Tags: patch

Found in version 24.3.50

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 16090 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: Andreas Politz <politza <at> hochschule-trier.de>
Cc: 16090 <at> debbugs.gnu.org
Subject: Re: bug#16090: 24.3.50;
 [PATCH] error when jumping to a doc-view bookmark
Date: Mon, 09 Dec 2013 10:13:11 +0100
Andreas Politz <politza <at> hochschule-trier.de> writes:

> $ emacs -Q some.pdf
>
> C-x r m RET
> C-x k RET
> C-x r b some.pdf RET
>
> Debugger entered--Lisp error: (wrong-type-argument listp t)
>   image-mode-winprops(nil)

Indeed.

> The reason is that the buffer is not yet displayed, when
> doc-view-bookmark-jump tries to change the page.  This results in, for
> obscure reasons, trying to change the page in which ever window is
> currently selected.  Solution: Defer changing the page after
> bookmark--jump-via has displayed the page.

Here's a simpler patch which does also seem to fix the problem by simply
using find-file instead of bookmark's default handler without requiring
a timer.

--8<---------------cut here---------------start------------->8---
=== modified file 'lisp/doc-view.el'
--- lisp/doc-view.el	2013-01-01 09:11:05 +0000
+++ lisp/doc-view.el	2013-12-09 08:55:30 +0000
@@ -1653,14 +1653,11 @@
 (defun doc-view-bookmark-jump (bmk)
   ;; This implements the `handler' function interface for record type
   ;; returned by `doc-view-bookmark-make-record', which see.
-  (prog1 (bookmark-default-handler bmk)
+  (prog1 (find-file (bookmark-get-filename bmk))
     (let ((page (bookmark-prop-get bmk 'page)))
       (when (not (eq major-mode 'doc-view-mode))
-        (doc-view-toggle-display))
-      (with-selected-window
-       (or (get-buffer-window (current-buffer) 0)
-	   (selected-window))
-       (doc-view-goto-page page)))))
+	(doc-view-toggle-display))
+      (doc-view-goto-page page))))
--8<---------------cut here---------------end--------------->8---

Could you check if that also fixes the issue for you?

And a question concerning the procedure: since this is a fix for a bug
relative to emacs 23, should I commit it on the emacs-24 branch?

Bye,
Tassilo




This bug report was last modified 11 years and 51 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.