Describe the bug
Sometimes when i edit an annotation, I receive the error in the title and am unable to update the annotation's contents. Backtrace below.
My annotations are highlight/text type. I edit one by clicking on it.
I cannot yet discern what triggers this, and it does not always happen. I also find that if i keep annotating the pdf, then return later to the annotation, it will let me edit it. Again I'm unable to determine what makes the issue go away.
I understand if my bug report is too vague, I just thought to report in case anyone else encounters it and can narrow down the trigger.
I can't share the pdf at present as it is for a client, but I have encountered this with various pdfs.
Steps to Reproduce the behaviour
Steps to reproduce the behaviour:
Open a pdf
Create highlight annotation: mark a region, then C-c C-a h (actually I use my binding, C to call pdf-annot-add-highlight-markup-annotation-and-copy-region defined below), create some text, then C-c C-c (pdf-annot-edit-contents-commit)
Click on the annotation to edit it.
Change the text, then C-c C-c (pdf-annot-edit-contents-commit) when done, error appears.
What is the expected behaviour?
I expect the edited annotation to be modified (and the file to be saved)
Desktop
Please complete the following information:
OS: MX Linux (Debian Stable)
Emacs Version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2023-10-08
Poppler Version: i don't know how to provide that for my OS, yr instructions are for brew. which poppler returns nothing. my libpoppler packages have version 22.12.0-2+b1.
Your pdf-tools install
Please complete the following information:
pdf-tools Version: i use straight.el (regularly updated). not sure how to provide version.
pdf-tools customization / configuration:
(here's what i have relevant to pdf-annot:)
(defun pdf-annot-add-highlight-markup-annotation-and-copy-region ()
"Copy text in region before creating a highlight annotation."
(interactive)
(progn
(pdf-view-kill-ring-save-keep-region)
(pdf-annot-add-highlight-markup-annotation (pdf-view-active-region))))
;; wrapper for save-buffer ignoring arguments
(defun mb/save-buffer-no-args ()
"Save buffer ignoring arguments"
(save-buffer))
;; save after adding comment
(with-eval-after-load "pdf-annot"
(advice-add 'pdf-annot-edit-contents-commit :after 'mb/save-buffer-no-args))
(with-eval-after-load "pdf-annot"
(define-key pdf-annot-edit-contents-minor-mode-map (kbd "C-c C-k") 'pdf-annot-edit-contents-abort))
Describe the bug Sometimes when i edit an annotation, I receive the error in the title and am unable to update the annotation's contents. Backtrace below.
My annotations are highlight/text type. I edit one by clicking on it.
I cannot yet discern what triggers this, and it does not always happen. I also find that if i keep annotating the pdf, then return later to the annotation, it will let me edit it. Again I'm unable to determine what makes the issue go away.
I understand if my bug report is too vague, I just thought to report in case anyone else encounters it and can narrow down the trigger.
I can't share the pdf at present as it is for a client, but I have encountered this with various pdfs.
Steps to Reproduce the behaviour Steps to reproduce the behaviour:
C-c C-a h
(actually I use my binding,C
to callpdf-annot-add-highlight-markup-annotation-and-copy-region
defined below), create some text, thenC-c C-c
(pdf-annot-edit-contents-commit
)C-c C-c
(pdf-annot-edit-contents-commit
) when done, error appears.What is the expected behaviour? I expect the edited annotation to be modified (and the file to be saved)
Desktop Please complete the following information:
which poppler
returns nothing. my libpoppler packages have version 22.12.0-2+b1.Your pdf-tools install Please complete the following information:
pdf-tools
Version: i use straight.el (regularly updated). not sure how to provide version.pdf-tools
customization / configuration: (here's what i have relevant to pdf-annot:)Additional context the backtrace looks like so: