4

I have multiple overlays with 'help-echo strings covering the same region. Can I make Emacs show all these strings in the mouseover tooltip? By default it only shows the one coming from the highest priority overlay.

EDIT: The context is FlyCheck: a checker reports errors and warnings for the same position in the buffer, and the tooltip for that position only mentions the errors.

5

The help-echo property can be a function that returns the actual string to display, so you could add an additional overlay with higher priority with a special help-echo property which will compute the union/concatenation of all the help-echo properties it covers.

| improve this answer | |
  • Ah, that's a pretty cool idea! – Clément Aug 14 '15 at 6:14
1

No, not unless you run some code that combines the overlays, e.g., replacing some with one.

For example, get the help-echo property from whichever you like, and add the text in it to the help-echo property of whichever overlay has the highest priority. Or create an overlay with a higher priority than the others, and whose help-echo property has all of the text that you want, derived from the property on the other overlays.

Overlay priorities are designed to let you mask one overlay by another. That masking includes their help-echo strings.

(But it might be that if you describe your exact context in more detail there is another solution.)

| improve this answer | |
  • Great answer, thanks. The context is flycheck, so I guess that means I'll need to make a feature request or a patch :) – Clément Aug 14 '15 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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