From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: why 4 inotfy events when saving a file? Date: Mon, 11 Mar 2013 21:21:14 -0500 Organization: NewsGuy - Unlimited Usenet $23.95 Message-ID: References: <20130310214442.GA8538@boo.workgroup> <83ehfmx5xz.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1363080195 32324 80.91.229.3 (12 Mar 2013 09:23:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Mar 2013 09:23:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 12 10:23:40 2013 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 1UFLQq-0008TF-4b for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Mar 2013 10:23:40 +0100 Original-Received: from localhost ([::1]:58702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFLQT-00070M-OG for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Mar 2013 05:23:17 -0400 Original-Path: usenet.stanford.edu!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!news4 Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-NNTP-Posting-Host: pce90198b09120fe1682595adb4c9ffdc96f4f634b99b5006.newsdawg.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: X-Received-Bytes: 1906 Original-Xref: usenet.stanford.edu gnu.emacs.help:197199 X-Mailman-Approved-At: Tue, 12 Mar 2013 05:22:54 -0400 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:89481 Archived-At: > Hi Eli, Emacs users and developers, > * Eli Zaretskii [11. Mar. 2013]: >>> Date: Sun, 10 Mar 2013 22:44:42 +0100 >>> From: Gregor Zattler >>> >>> saving a file from Emacs gives 4 inotify events: > [...] >>> why are there so many events? >> >> Because that's what Emacs does when it saves the file, first to the >> old version, then to the new. Take a look at the implementation of >> write-region, which is the primitive used by save-buffer to write the >> buffer to its file, you will see all those operations there. > > Thanks (also to Barry Margolin) for the explanation. I now > search for a after-file-save-hook. But I didn't find it. Is > there some such thing? C-h v after TAB shows: after-save-hook is a variable defined in `files.el'. Its value is nil This variable is potentially risky when used as a file local variable. Documentation: Normal hook that is run after a buffer is saved to its file. You can customize this variable. Ed > > > Ciao, Gregor >