Open ghost opened 3 years ago
Thanks for reporting this here. I'll look into this over the next weekend and share an update.
I also use bookmark+ and my workaround is to change the handler
from pdf-view-bookmark-jump-handler
to pdf-view-bookmark-jump
. I do not complely understand the hook, but anyway pdf-view-bookmark-jump-handler
is called by pdf-view-bookmark-jump
so this should be the correct entry point in the pdf-view-make-record
function.
At the moment I patch it with el-patch like this:
(el-patch-defun pdf-view-bookmark-make-record (&optional no-page no-slice no-size no-origin)
;; TODO: add NO-PAGE, NO-SLICE, NO-SIZE, NO-ORIGIN to the docstring.
"Create a bookmark PDF record.
The optional, boolean args exclude certain attributes."
(let ((displayed-p (eq (current-buffer)
(window-buffer))))
(cons (buffer-name)
(append (bookmark-make-record-default nil t 1)
`(,(unless no-page
(cons 'page (pdf-view-current-page)))
,(unless no-slice
(cons 'slice (and displayed-p (pdf-view-current-slice))))
,(unless no-size
(cons 'size pdf-view-display-size))
,(unless no-origin
(cons 'origin
(and displayed-p
(let ((edges (pdf-util-image-displayed-edges nil t)))
(pdf-util-scale-pixel-to-relative
(cons (car edges) (cadr edges)) nil t)))))
(handler . (el-patch-swap pdf-view-bookmark-jump-handler pdf-view-bookmark-jump)))))))
If I bookmark a PDF with bookmark+, I am getting this error when I try to open it:
pdf-info--normalize-file-or-buffer: Buffer is not associated with any file *Bookmark List*
And the file does not open.
This error only occurs with pdf-tools, and not if I bookmark the file with doc-view.
Here is the backtrace error.
I contacted the developer of bookmark+ about this first and this was his response: