Tassilo Horn <tsdh@gnu.org> writes:
(set-text-properties (match-beginning 0) (match-end 0)
'(help-echo "Tooltip text"
font-lock-face 'my-custom-face))
Can I do this in `font-lock-add-keywords`?
Yes, you can.
If so, how?
This adds a "Foo or Bar" tooltip to any occurences of the words foo or
bar in the current buffer.
(font-lock-add-keywords nil
'(("\\<\\(foo\\|bar\\)\\>" 1 '(face nil help-echo "Foo or Bar"))))
And I think you will want to add help-echo to
`font-lock-extra-managed-props'.
Bye,
Tassilo