4

In org mode when I hover over a link, I get a tooltip that shows the target of the link. But I'd like to see the target when I just move point onto a link, either as a tooltip or in the echo area. For example, with:

* a headline
and a [[https://orgmode.org/][link to orgmode.org]]. And an internal link
[[id:20191211T100231.972516][to a headline in this file]].

* another headline with an ID property
  :PROPERTIES:
  :ID:       20191211T100231.972516
  :END:
content

If point is somewhere in the "link to orgmode.org" text, I'd like to see something like LINK: https://orgmode.org displayed in the echo area, or as a tooltip. Similarly for the internal link: it would be cool if the displayed text actually went and looked up the headline title and displayed LINK: "another headline with an ID property"

Is there a way to do this?

1
  • org seems to be doing pretty much the right thing: it's setting the :help-echo text property, which hooks up to emacs' tooltips: gnu.org/software/emacs/manual/html_node/emacs/…. I can do M-x tooltip-mode and get what I want...but for the mouse pointer, not the cursor: when I put the pointer over the text, I see the tooltip in the echo area. I want that to happen when the cursor/point is on the link. So how to detect /that/?
    – Dan Drake
    Commented Dec 12, 2019 at 22:13

1 Answer 1

6

tl;dr: do M-x customize-variable for the variable help-at-pt-display-when-idle and set its value to t. (Or "always", which is what the Customize buffer says.)

What was initially confusing here is that there's the mouse pointer, and also the cursor (which here on emacs.sx we call point). As mentioned above, org-mode by default sets the :help-echo property for links, which works with emacs' built-in mouse tooltip support. The idea of a "point tooltip" is separate, and, fortunately, is a solved problem: quoth 10.10 Help on Active Text and Tooltips:

On terminals that don't support mouse-tracking, you can display the help text for active buffer text at point by typing C-h . (display-local-help). This shows the help text in the echo area. To display help text automatically whenever it is available at point, set the variable help-at-pt-display-when-idle to t.

Note that help-at-pt-display-when-idle doesn't immediately work if you enable it with M-x set-variable; from the variable's documentation:

This variable only takes effect after a call to help-at-pt-set-timer. The help gets printed after Emacs has been idle for help-at-pt-timer-delay seconds. You can call help-at-pt-cancel-timer to cancel the timer set by, and the effect of, help-at-pt-set-timer.

When this variable is set through Custom, help-at-pt-set-timer is called automatically,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.