fuxialexander / org-pdftools

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

org-noter-insert-note not working properly #51

Closed n14s closed 3 years ago

n14s commented 3 years ago

Hey,

I'm setting up the org-noter workflow as mentioned in the description or in the youtube video and I'm having problems with the step of inserting the notes.

When I highlight the text and execute the org-noter-insert-note command Emacs doesn't create a header in the org file as shown in the workflow. It instead creates a regular annotation and opens its annotation minibuffer. No header is created in the org file and the note counter in the pdf buffer remains 0.

I uploaded a video of it here: https://www.youtube.com/watch?v=0vg-lis08sU

I'm using doom. My dotfiles can be found here: https://github.com/n14s/doomdotfiles

n14s commented 3 years ago

The error in the message buffer proposes that the image-mode-window-get method receives a wrong argument.

image-mode-window-get: Wrong type argument: listp, t

The method appears in the org-noter-pdftools.el once at line 225: (number-to-string (image-mode-window-get 'page))

and also once in the org-pdftools.el at line 264ff: (or (image-mode-window-get 'vscroll) 0)

From preceding code I can identify that the method is indeed invoked when this error occurs, but with my limited knowledge I cannot say if there's anything wrong with it or if the problem lays somewhere else.

Any suggestions are heartily welcomed.

saminahbab commented 3 years ago

I have the same issue by the way, from the video

fuxialexander commented 3 years ago

Can you help check whether it works now after the newest update? Please make sure to use the new usage instructions.

n14s commented 3 years ago

Hey there, I just tested the update.

So I just installed a fresh emacs 27.1 with doom and pinned the newest commit in the org-pdftools and org-noter-pdftools. I checked in the emacs folder and it is indeed the newest commit. I also use the config you suggest in the README.

Here is what I found out, while following along the demo video on your youtube channel:

  1. Create Skeleton works
  2. Syncing of Notes when browsing pdf works
  3. Insert Note only with limited functionality:
    • I don't get asked to point to a location
    • There appears no symbol on the pdf-page
    • The Note bullet point in the notes buffer is created though
    • Highlighting and inserting link results in the same output as in my video. No change
  4. Notes and header bullet point can be followed with org-open-at-point
  5. Cross-ref link cannot be generated: M-u is bound to make uppercase. Cannot find an appropiate command with M-x.
  6. Cannot find any org-pdftools commands with M-x: I don't know if this is a expected behaviour. Are the functions in the org-pdftools.el not supposed to be invoked manually with M-x? Is one of them maybe the one to great the cross-ref link?

So all in all, this package is unfortunately still not usable for me. I can only create notes with a vague link to a page, since there is no annotation in the pdf. I hope this is going to be resolved soon. The idea is great. :)

fuxialexander commented 3 years ago

Which platform are you on? Windows? I still cannot replicate the issue you encountered.

fuxialexander commented 3 years ago

Is org-store-link in the pdf buffer with highlighted region, then org-insert-link in org buffer working for you? M-u is bound to org-store-link in my config

n14s commented 3 years ago

I'm on Ubuntu 18.04. I think I just resolved the problem.

I just tried your suggestion of using org-store-link on a highlighted region of the pdf-buffer. It results in the same behaviour with the minibuffer and the Wrong type argument error like in the video. The link is not stored - it does not appear when using org-insert-link in the org-buffer. Using org-store-link in the org-buffer itself on a "vaguely coupled" org-note as describe in my previous comment results in the desired behaviour. Therefore I followed that my problem lies purely within the pdf-viewer, since any interaction with it, results in errors.

So first thing I did was uncommenting the little config I had set regarding the pdf viewer, which is basically just a few key maps and one or two display settings. Somehow these settings must have interfered with package. Without those settings, the package functions seem to work as intended.

I hope anybody facing the same problems will find this helpful.

Thanks for the suggestion Alex.

fuxialexander commented 3 years ago

That's great!

gutofarias commented 3 years ago

Hello,

I had the same issue.. Took me a while to figure it out but the problem is with: (setq pdf-annot-activate-created-annotations t)

When this is commented everything works fine!

By the way, thanks for the awesome packages!