bastibe / annotate.el

Annotate.el
Other
384 stars 20 forks source link

It would be nice if "annotate-use-echo-area" worked without the use of the mouse #136

Closed alienbogart closed 1 year ago

alienbogart commented 1 year ago

For example, leaving the cursor above the note would display its content in the echo area instead of requiring me to use the mouse. I don't really use the mouse on Emacs so it would be nice to be able to do this with the keyboard. Thanks!

cage2 commented 1 year ago

Hi @alienbogart !

I like your idea! The only issue is that i do not know how to make Emacs generates (and reacts) to an event like "the cursor is placed over some annotated text", three possible approaches maybe could be explored (not an exhaustive list below, these are just the ones coming to mind):

  1. using an hooks, but i do not think an hook run when the cursor is moved exists (but i may be wrong)
    • will running this hooks kill the performance?
  2. using run-with-idle-timer with an high frequency
    • even if it does works, will the users be annoyed with the delay associated with the timer?
    • again, what about the performance?
  3. Transform the annotated text in a button
    • will necessarily require the user to press the button to popup the annotation's text?
    • the appearance of the annotate text will be affected by the fact that ha been transformed in a button? I think yes, but how and how much?

I think # 2 is the best option, so i would starts exploring that. If you have some other idea let me know, of course! :)

Bye! C.

cage2 commented 1 year ago

Hi @alienbogart !

I have added a few lines of code in this branch:

https://github.com/cage2/annotate.el/tree/print-message-annotate-under-point

The code will print the annotation under cursor in the minibuffer, if the text is annotated of course!

This branch is no more that a proof of concept, nevertheless i would be glad if you would be try it and tell me if the results of this patch are more or less the whet you expected from your suggestion.

Thanks in advance! C.

cage2 commented 1 year ago

Hi @alienbogart !

I believe that the patch #137 implement your suggestion. Let me know it it does not!

Thanks again! C.