fuxialexander / org-pdftools

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

Wrong type argument: listp, #s(org-noter-pdftools--location...) #96

Open armindarvish opened 11 months ago

armindarvish commented 11 months ago

Org-noter-pdftools breaks org-noter! I am using https://github.com/org-noter/org-noter. and without org-noter-pdftools, it works just fine, but when I install org-noter-pdftools, then I cannot insert notes with long selection anymore, only if I select a short sections (3 words or so) I can make a note. I get an erros like this:

I cannot insert note with long-selection, only short selection can cteate notes. org-noter-pdf--pretty-print-location-for-title: Wrong type argument: listp, #s(org-noter-pdftools--location ....

I thought the issues might be with the org-noter-set-start-location but no matter what I tried it fails. I even tried require org-noter-integration to use this file in org-noter\org-noter repo: (https://github.com/org-noter/org-noter/blob/master/other/org-noter-integration.el)[https://github.com/org-noter/org-noter/blob/master/other/org-noter-integration.el] but the issue persists.

Now, I can use org-noter without org-noter-pdftools for taking notes but I would like to have the possibility to export notes to pdf. Is there a minimal set-up I can use that does not mess with how org-noter adds notes and locations,...?

k-jell commented 11 months ago

I got the same issue. See here: https://github.com/org-noter/org-noter/issues/54 for a backtrace.

ghost commented 11 months ago

Can you tell us concrete versions of Emacs and all the packages?

k-jell commented 11 months ago

These are my versions:

org-version-Output: Org mode version 9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)

From list-packages:

  org-noter-pdftools             20230725.1433  installed             Integration between org-pdftools and org-noter
  org-noter                      20230728.2037  installed             A synchronized, Org-mode, document annotator

You need versions of any other packages than those?

lazzalazza commented 5 months ago

Hi, I have published this workaround also here, where the issue seems closed, but as I understand actually it is not. I have a functioning workaround, but it's just a patch:

;; Added patch function
(defun org-noter--check-and-convert-location (location)
  "If the location is an org-noter-pdftools-location, it transforms 
it into a (page . height) cons, otherwise it keeps the cons
unaltered"
  (if (org-noter-pdftools--location-p location)
      (cons (org-noter-pdftools--location-page location)
            (org-noter-pdftools--location-height location))
    location))

also, line 2262 of org-noter-core.el should be changed in: (org-noter--pretty-print-location-for-title (org-noter--check-and-convert-location location))

The real problem is where to put this function if one uses org-noter without org-noter-pdftools...