From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Raffaele Ricciardi Newsgroups: gmane.emacs.help Subject: Re: Adding a tooltip to text that matches a regexp? Date: Sat, 22 Nov 2014 13:48:06 +0100 Message-ID: References: <87vbm957gh.fsf@thinkpad-t440p.tsdh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1416660633 8032 80.91.229.3 (22 Nov 2014 12:50:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Nov 2014 12:50:33 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 22 13:50:26 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XsA8u-0006sN-Md for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Nov 2014 13:50:24 +0100 Original-Received: from localhost ([::1]:45193 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsA8u-0007kU-CA for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Nov 2014 07:50:24 -0500 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: individual.net vPfgSusnO/d8BaYqSskqUgIqxaCLu64Co+9IaWpH7ufpqHmL2F Cancel-Lock: sha1:YSgDiUcHC8WietoqQZO74Do7miw= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 In-Reply-To: Original-Xref: usenet.stanford.edu gnu.emacs.help:208833 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101113 Archived-At: On 21/11/14 09:30, Tassilo Horn wrote: > Tassilo Horn 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 > Thank you. Should I make `font-lock-extra-managed-props' buffer local?