fuxialexander / org-pdftools

A custom org link type for pdf-tools
GNU General Public License v3.0
331 stars 35 forks source link

Can not create skeleton #53

Closed acastanedam closed 3 years ago

acastanedam commented 3 years ago

Hi, I have installed the package (through use-package from Melpa) and configure as it written in the instructions. Then, from a pdf file try to create a skeleton of the annotations in such file, but get from org-noter-pdftools-create-skeleton:

helm-M-x-execute-command: Symbol’s value as variable is void: org-noter-pdftool-link-generator

or from org-noter-create-skeleton

helm-M-x-execute-command: Wrong type argument: org-noter-pdftools--location, nil

although, this time, the highlighted annotations are created. Note also if I comment out the org-pdftools lines, then org-noter-create-skeleton works.

Thanks in advance for your help,

Arcesio Castaneda

Shurakai commented 3 years ago

I also have this error. Here is a backtrace when calling org-noter-create-skeleton:

(wrong-type-argument org-noter-pdftools--location nil)
  signal(wrong-type-argument (org-noter-pdftools--location nil))
  org-noter-pdftools--pretty-print-location((4 . 0.115664))
  run-hook-with-args-until-success(org-noter-pdftools--pretty-print-location (4 . 0.115664))
  org-noter--pretty-print-location((4 . 0.115664))
  org-noter-create-skeleton()
  funcall-interactively(org-noter-create-skeleton)
  call-interactively(org-noter-create-skeleton record nil)
  command-execute(org-noter-create-skeleton record)
  execute-extended-command(nil "org-noter-create-skeleton" "org-noter-create-sk")
  funcall-interactively(execute-extended-command nil "org-noter-create-skeleton" "org-noter-create-sk")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

So only

* Skeleton
** Table of Contents

was generated.

When calling org-noter-pdftools-create-skeleton, I get the right outline.

Before discovering the latter, I decided to replace most of the body in org-noter-pdftools--pretty-print-location by (number-to-string (car location)). At least this helped me generated the structure, but it's clearly not what I wanted.

fuxialexander commented 3 years ago

Can you test whether org-noter-pdftools-create-skeleton works now?

Shurakai commented 3 years ago

org-noter-pdftools-create-skeleton worked for me (as noted above), org-noter-create-skeleton didn't. I looked at the commits but didn't see anything with respect to this, so I'll give it a try only once you confirm that it was just a typo.

fuxialexander commented 3 years ago

That's the intended behavior. I don't want to break the backward compatibility with the original org-noter location format. You can directly bind to org-noter-pdftools-create-skeleton instead or override org-noter-create-skeleton using an advice