nobiot / org-remark

Highlight & annotate text, EWW, Info, and EPUB
https://nobiot.github.io/org-remark/
GNU General Public License v3.0
425 stars 20 forks source link

view note as tooltip/mouseover #32

Closed mooseyboots closed 1 year ago

mooseyboots commented 2 years ago

is this currently possible? e.g. help-echo text property on the mark holding note text (possibly an extract).

nobiot commented 2 years ago

No, this is not available. I tried to implement something g similar (an icon when there is notes for a highlight); the approach I took at that time didn’t work out well. I haven’t tried a new approach since.

nobiot commented 2 years ago

Id welcome a PR.

mooseyboots commented 2 years ago

i got a rough version of this working, just not sure how it wd interact with the rest of your package, as i don't know the code at all (or how to use your package, as you can see from my other issues!)

mooseyboots commented 2 years ago

here's what i did.

a function org-remark-highlights-text-get to collect the text from a note subtree, then feed it down through the functions to add as a text help-echo property.

provisos:

mooseyboots commented 2 years ago

updated to use (org-end-of-subtree) to fetch subtree text.

nobiot commented 2 years ago

Thank you. Before I review your PR, have you done the FSF paperwork?

https://github.com/nobiot/org-remark#contributing-and-feedback

Create issues, discussion, and/or pull requests in the GitHub repository. All welcome.

Org-remark is available on GNU ELPA and thus copyrighted by the Free Software Foundation (FSF). This means that anyone who is making a substantive code contribution will need to “assign the copyright for your contributions to the FSF so that they can be included in GNU Emacs” (Org Mode website).

Thank you.

mooseyboots commented 2 years ago

i just set the process in motion now.

i also just thought to show you how i thought to add the text properties -- i don't mind if you just incorporate the code yourself if you dig it.

mooseyboots commented 2 years ago

FSF copyright assignment is done.

nobiot commented 2 years ago

Thank you! Let me have some time to review the PR — I’m a bit under the water at the moment…

nobiot commented 2 years ago

Sorry, it's been a while. My head space is still very limited, and can't properly test the PR. I think it will need to be Nov/Dec 2022 earliest -- I have a big life event coming up in October.

I had a quick look. Two things to note:

  1. Documentation needs to be done (I could do this of course when I can come back)
  2. The code looks to me that it does not display the text excerpt for a newly created highlight?

The second point is something I'd like to spend some time on testing to ensure if my understanding is correct...

mooseyboots commented 2 years ago

@nobiot no worries about the pace of things.

re 2, maybe you mean it does not work for a new highlight? because for a new highlight, the highlight is created before any annotation text is provided. for me it does work for annotations that are not new, i.e. if i reload the file with find-alternate-file.

i added a commit: we fetch the text from the highlights list and update the overlay on save. but this is also not ideal, as it only runs when we save the main buffer. best would be to update when the notes file itself is changed/saved. but that's beyond me for today.

edit: an option would be to have a C-c C-c command in the notes buffer, which would serve as a way of ending work on a note, akin to the same binding in org-capture. then we'd have an event to do any updating needed, any housekeeping, optionally kill or hide the notes buffer, and return to the main buffer. but that wd require a minor mode in the notes buffer...

nobiot commented 1 year ago

@mooseyboots, finally I took time to merge your PR. Thank you! Will update documentation and acknowledge your contribution. Cheers.

nobiot commented 1 year ago

i added a commit: we fetch the text from the highlights list and update the overlay on save. but this is also not ideal, as it only runs when we save the main buffer. best would be to update when the notes file itself is changed/saved. but that's beyond me for today.

For now, I have removed this part of the code. Will think about a generic communication from the notes back to the source...