-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PDF annotations disappear upon saving #28
Comments
Hey @faaip, I am not able to reproduce your problem (I don't use
In the above cases, the annotation remains and is not lost. Perhaps it's possible that the PDF file you are reading is uncovering |
I think this might be related to politza/pdf-tools#646, fuxialexander/org-pdftools#68 and https://org-roam.discourse.group/t/cannot-save-annotations-in-org-noter-pdf-and-see-when-i-open-up-again/915 I'm experiencing a similar issue but since there are so many different packages involved I'm not sure where ask for help. Things that I have notices:
My workaround currently looks like this:
When reopening the pdf via
This can be solved by activating It seems quite complicated to reproduce it since several packages seem to interact in a way that breaks stuff:
I think we need to figure out why the pdf buffer gets
@vedang If this is not directly caused by pdf-tools. Do you have an idea how some of the other packages could mess with pdf annotation saving? [0] I had to add |
I found a fix for this here: (add-hook 'pdf-view-mode-hook #'pdf-annot-minor-mode)
(add-hook 'pdf-view-mode-hook (lambda () (read-only-mode 0)))
;; save after adding annotation comment
(advice-add 'pdf-annot-edit-contents-commit :after 'save-buffer) |
@fapdash. Thank you for linking to the other issue. I am a novice (if it wasn't obvious), so take what I'm saying with a pinch of salt...
All in all, this is a good fix, I just need to get in the habit of calling ':wa'. However there are still some cases where the annotations get dropped. |
@Muff2n I have no experience witth Spacemacs and evil-mode. |
I have determined that ':w' leads to the command 'evil-write' being called. This is a function defined in evil-commands.el, which is a spacemacs file. Unfortunately my elisp isn't great, so I am not able to understand more than that it will try to call save-buffer (which does work on the pdf) but there is more complicated logic in the file, which must be responsible for the failure. Where do you think would be the best place to report this? I've never experienced evil-write not working before. |
@Muff2n |
@fapdash Thanks for sharing this fix! Combined with my autosave config, annotations are now saving without needing to explicitly call write/save from the pdf file. |
Hi!
I'm running into an error on macOS where the annotations disappear upon saving the pdf.
To reproduce:
Do you have any idea what might be the issue?
Thank you for taking this fork.
The text was updated successfully, but these errors were encountered: