Closed sati-bodhi closed 1 year ago
@nobiot, I've fixed the problem downstream with the following config.el
settings:
(use-package! org-remark
...
(map! :leader
(:prefix-map ("r" . "reading")
:desc "Make highlight annotation for EPUB or PDF" "h" #'my-reading-make-highlight-annotation)
...
)
(defun my-reading-make-highlight-annotation ()
"Highlight text and activate the annotation notes for input.
This single function can be called for both EPUBs and PDFs."
(interactive)
(cond ((eq major-mode 'nov-mode)
(apply 'org-remark-mark (org-remark-region-or-word))
(org-remark-view (- (point) 1))
(switch-to-buffer "*marginal notes*")
(evil-org-open-below 1))
((eq major-mode 'pdf-view-mode)
(pdf-annot-add-highlight-markup-annotation pdf-view-active-region)
(evil-insert 1)
)))
I'll leave it up to you to decide if it is necessary to add that filter upstream at source level.
Thanks. I will think of a way upstream for dev/nov.el
branch.
Fix 32149d5 is in the dev/nov.el
branch.
When you have some time, I'd appreciate it if you could test it on your end.
When you have some time, I'd appreciate it if you could test it on your end.
Tested the fix.
It now exits with org-remark: Highlights not saved; buffer is not supported
when org-remark-mark
is called on a PDFView
buffer, which is what we want.
Guess we can close this issue for now.
Org-remark
doesn't work with PDFs.This is because of the PDF file structure, which EMACS renders as images. As a result, annotations are handled differently within the PDF file specification.
When we accidentally call
org-remark-mark
on a PDF, we get the following text inserted intomarginalia.org
:We can do nothing about it except manually remove the insertion from the file, which is an inconvenience that disrupts the reading workflow.
Could some kind of filter be written to exclude
pdf-view-mode
from the default set up?