org-pdftools
org-pdftools copied to clipboard
Org-noter can’t insert skeleton when used with org-noter-pdftools
I activate org-noter-pdf-tools like this in my init file
(with-eval-after-load 'org-noter (require 'org-noter-pdftools))
(with-eval-after-load 'org (org-pdftools-setup-link))
Then, I issue org-noter-create-skeleton on the attached file, asking to import all annotations with their contents. Skeleton insertion stops short, after
** Skeleton
*** Highlight on page 1
Toggling debug-on-error gives the following output:
Debugger entered--Lisp error: (wrong-type-argument org-noter-pdftools--location nil)
signal(wrong-type-argument (org-noter-pdftools--location nil))
org-noter-pdftools--pretty-print-location((1 . 0.7950083333333333))
org-noter--pretty-print-location((1 . 0.7950083333333333))
#<subr org-noter-create-skeleton>()
apply(#<subr org-noter-create-skeleton> nil)
org-noter-create-skeleton()
funcall-interactively(org-noter-create-skeleton)
command-execute(org-noter-create-skeleton record)
execute-extended-command(nil "org-noter-create-skeleton" nil)
funcall-interactively(execute-extended-command nil "org-noter-create-skeleton" nil)
command-execute(execute-extended-command)
Removing the two lines about org-noter-pdf-tools from the init file restores a functional org-noter-create-skeleton.
I get the same error when trying to insert the outline of a PDF file containing an abstract and sections using org-noter-create-skeleton. Skeleton insertion stops short, after
** Skeleton
*** Abstract
Trying to insert a precise note also eventually leads to the same error (wrong-type-argument org-noter-pdftools--location nil) via org-noter-pdftools--pretty-print-location((2 . 0)). Full backtrace below:
Debugger entered--Lisp error: (wrong-type-argument org-noter-pdftools--location nil)
signal(wrong-type-argument (org-noter-pdftools--location nil))
(or (progn (and (memq (type-of loc) cl-struct-org-noter-pdftools--location-tags) t)) (signal 'wrong-type-argument (list 'org-noter-pdftools--location loc)))
(progn (or (progn (and (memq (type-of loc) cl-struct-org-noter-pdftools--location-tags) t)) (signal 'wrong-type-argument (list 'org-noter-pdftools--location loc))) (aref loc 6))
(concat "[[" (progn (or (progn (and (memq (type-of loc) cl-struct-org-noter-pdftools--location-tags) t)) (signal 'wrong-type-argument (list 'org-noter-pdftools--location loc))) (aref loc 6)) "]]")
(let ((loc (if (progn (and (memq (type-of location) cl-struct-org-noter-pdftools--location-tags) t)) location (org-noter-pdftools--parse-link location)))) (concat "[[" (progn (or (progn (and (memq (type-of loc) cl-struct-org-noter-pdftools--location-tags) t)) (signal 'wrong-type-argument (list 'org-noter-pdftools--location loc))) (aref loc 6)) "]]"))
(if (memq (progn (or (progn (and (memq (type-of session) cl-struct-org-noter--session-tags) t)) (signal 'wrong-type-argument (list 'org-noter--session session))) (aref session 7)) '(doc-view-mode pdf-view-mode)) (let ((loc (if (progn (and (memq ... cl-struct-org-noter-pdftools--location-tags) t)) location (org-noter-pdftools--parse-link location)))) (concat "[[" (progn (or (progn (and (memq ... cl-struct-org-noter-pdftools--location-tags) t)) (signal 'wrong-type-argument (list 'org-noter-pdftools--location loc))) (aref loc 6)) "]]")) nil)
(progn (if (memq (progn (or (progn (and (memq ... cl-struct-org-noter--session-tags) t)) (signal 'wrong-type-argument (list 'org-noter--session session))) (aref session 7)) '(doc-view-mode pdf-view-mode)) (let ((loc (if (progn (and ... t)) location (org-noter-pdftools--parse-link location)))) (concat "[[" (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... loc))) (aref loc 6)) "]]")) nil))
(progn (progn (if (memq (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (aref session 7)) '(doc-view-mode pdf-view-mode)) (let ((loc (if (progn ...) location (org-noter-pdftools--parse-link location)))) (concat "[[" (progn (or (progn ...) (signal ... ...)) (aref loc 6)) "]]")) nil)))
(if (org-noter--valid-session session) (progn (progn (if (memq (progn (or (progn ...) (signal ... ...)) (aref session 7)) '(doc-view-mode pdf-view-mode)) (let ((loc (if ... location ...))) (concat "[[" (progn (or ... ...) (aref loc 6)) "]]")) nil))))
(let ((session org-noter--session)) (if (org-noter--valid-session session) (progn (progn (if (memq (progn (or ... ...) (aref session 7)) '(doc-view-mode pdf-view-mode)) (let ((loc ...)) (concat "[[" (progn ... ...) "]]")) nil)))))
org-noter-pdftools--pretty-print-location((2 . 0))
run-hook-with-args-until-success(org-noter-pdftools--pretty-print-location (2 . 0))
org-noter--pretty-print-location((2 . 0))
org-noter--insert-heading(2 "A note for RQ3" 1 (2 . 0))
org-noter-insert-note(#s(org-noter-pdftools--location :path "pdf:~/proposal-sourav-saha.pdf" :page 2 :height 4.4 :annot-id "annot-2-5" :search-string nil :original-property "pdf:~/proposal-sourav-saha.pdf::2++4.40;;annot-2-5"))
org-noter-insert-precise-note(nil)