From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: editing buffer -> call function Date: Mon, 18 May 2009 21:24:48 +0200 Message-ID: References: <4A117F1A.1050500@irisa.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1242674725 977 80.91.229.12 (18 May 2009 19:25:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 May 2009 19:25:25 +0000 (UTC) Cc: emacs help To: Sebastien LE MAGUER Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 18 21:25:18 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M68Sa-00049p-0Z for geh-help-gnu-emacs@m.gmane.org; Mon, 18 May 2009 21:25:16 +0200 Original-Received: from localhost ([127.0.0.1]:43189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M68SZ-0007qA-1O for geh-help-gnu-emacs@m.gmane.org; Mon, 18 May 2009 15:25:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M68SB-0007pd-Jx for help-gnu-emacs@gnu.org; Mon, 18 May 2009 15:24:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M68SB-0007pK-61 for help-gnu-emacs@gnu.org; Mon, 18 May 2009 15:24:51 -0400 Original-Received: from [199.232.76.173] (port=43777 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M68SA-0007pF-TL for help-gnu-emacs@gnu.org; Mon, 18 May 2009 15:24:50 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:37701) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M68SA-0003Fo-4h for help-gnu-emacs@gnu.org; Mon, 18 May 2009 15:24:50 -0400 Original-Received: from thursday (e176228187.adsl.alicedsl.de [85.176.228.187]) by dd18200.kasserver.com (Postfix) with ESMTP id CD79418378DE4; Mon, 18 May 2009 21:24:54 +0200 (CEST) In-Reply-To: <4A117F1A.1050500@irisa.fr> (Sebastien LE MAGUER's message of "Mon, 18 May 2009 17:30:34 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (darwin) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64547 Archived-At: Sebastien LE MAGUER wrote: > I wonder how to call a function everytime a buffer is updated. For example : > - I want to highlight each instance a specific word > - Every time I write this word after the search, I want to highlight it > automatically or if I delete an instance of it clear the overlay. > > Can you help me ? Use the hook `after-change-functions'. Or you can leave the work to `highlight-regexp'. Look at highlight-symbol.el[1] for an example. regards, Nikolaj Schumacher [1]: http://nschum.de/src/emacs/highlight-symbol/