From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Wright Newsgroups: gmane.emacs.help Subject: Re: highlight-changes-remove Date: Tue, 26 Apr 2005 20:09:24 +0200 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1114538918 20676 80.91.229.2 (26 Apr 2005 18:08:38 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Apr 2005 18:08:38 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 26 20:08:36 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DQUSx-0005YZ-OJ for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Apr 2005 20:07:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQUYj-0002iQ-ER for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Apr 2005 14:13:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DQUYA-0002UL-79 for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 14:12:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DQUY8-0002RE-FT for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 14:12:45 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQUY8-0000ZF-8I for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 14:12:44 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DQUaV-0006x1-Cz for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 14:15:11 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DQUR4-00057E-OO for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 20:05:27 +0200 Original-Received: from pd9ed4648.dip0.t-ipconnect.de ([217.237.70.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Apr 2005 20:05:26 +0200 Original-Received: from daniel.d.wright by pd9ed4648.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Apr 2005 20:05:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 30 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: pd9ed4648.dip0.t-ipconnect.de User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:EUYRKcFye3KlKDkMHRck5aJ8Oy8= 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:26062 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26062 "Misto ." writes: > I use the highlight mode when editing my files. > I would like to bind the function highlight-changes-remove-highlight > when I save the > file. First is needed to select all the buffer and next invoke that function. > > How I can do that? Hi! I hope this is what you'd like have in your .emacs: (add-hook 'after-save-hook '(lambda() (if (boundp 'highlight-changes-mode) (highlight-changes-remove-highlight (point-min) (point-max))))) You can often find a hook to add behaviour like this (in this case after-save-hook), and then add the function you need to it. Calling the function highlight-changes-remove-highlight with the arguments above means that it operates on the whole buffer - you don't need to select the whole buffer first. You can get help for the function to see which arguments it takes, etc. with: C-h f highlight-changes-remove-highlight RET Graciously, Daniel.