Add a hook after "Inserting on an existing note" in org-noter-insert-note
abvbv opened this issue · comments
abvbv commented
I'd like to run some code after (insert selected-text)
in org-noter-insert-note
.
My use case:
- Open an EPUB book with nov.el.
- Make a note (
i
/org-noter-insert-note
). - Mark some text in the book, press
i
to insert it into the existing note. - The marked text is filled with a particular window width in mind [1] and so is the inserted text. I prefer it to be non-filled in my org files. So I have to mark the inserted paragraph (
M-h
/org-mark-element
) and join the lines (M-^
/org-delete-indentation
).
What's the best option to automate the last step?
[1] nov.el
uses shr.el
to render books and it fills all lines (shr-fill-lines
). I tried to turn it off, but for an unrelated reason I found it less convenient.
abvbv commented
This works for now:
(define-key nov-mode-map (kbd "f")
(lambda ()
(interactive)
(org-noter-insert-note)
(org-mark-element)
(org-delete-indentation)
(end-of-line)
(newline 2)
(other-window 1)
(keyboard-quit))
Don't forget to mark some text before using it.
Gonçalo, I'm ok with this issue to be closed.
c1-g commented
Did you try adding hook to org-noter-insert-heading-hook
?