bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Tassilo Horn
Subject: bug#16090: 24.3.50; [PATCH] error when jumping to a doc-view bookmark
Date: Fri, 04 Apr 2014 15:43:43 +0200
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.4.50 (gnu/linux)

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

> For emacs-24, your patch is too intrusive, so I think a patch along
> the lines of Andreas's might be acceptable, but it should use
> bookmark-after-jump-hook instead of using a timer.

Like so?

(defun doc-view-bookmark-jump (bmk)
  ;; This implements the `handler' function interface for record type
  ;; returned by `doc-view-bookmark-make-record', which see.
  (let ((page (bookmark-prop-get bmk 'page)))
    (add-hook 'bookmark-after-jump-hook
              (lambda ()
                (setq bookmark-after-jump-hook
                      (cdr bookmark-after-jump-hook))
                (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))))
    (bookmark-default-handler bmk)))

Bye,
Tassilo





reply via email to

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