From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Gregor Zattler Newsgroups: gmane.emacs.help Subject: Re: why 4 inotfy events when saving a file? Date: Tue, 12 Mar 2013 00:14:17 +0100 Message-ID: <20130311231417.GB26775@boo.workgroup> References: <20130310214442.GA8538@boo.workgroup> <83ehfmx5xz.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1363043763 1224 80.91.229.3 (11 Mar 2013 23:16:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Mar 2013 23:16:03 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 12 00:16:28 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 1UFBxC-0004ea-V3 for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Mar 2013 00:16:27 +0100 Original-Received: from localhost ([::1]:52134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFBwq-0006rd-EY for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Mar 2013 19:16:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFBwV-0006rN-UT for help-gnu-emacs@gnu.org; Mon, 11 Mar 2013 19:15:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFBwQ-0002Ua-A4 for help-gnu-emacs@gnu.org; Mon, 11 Mar 2013 19:15:43 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:59438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFBwQ-0002U9-0v for help-gnu-emacs@gnu.org; Mon, 11 Mar 2013 19:15:38 -0400 Original-Received: from mailout-de.gmx.net ([10.1.76.2]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0MaGNa-1UUWxs1dyi-00Jv3L for ; Tue, 12 Mar 2013 00:15:36 +0100 Original-Received: (qmail invoked by alias); 11 Mar 2013 23:15:36 -0000 Original-Received: from p508657E3.dip.t-dialin.net (EHLO boo.workgroup) [80.134.87.227] by mail.gmx.net (mp002) with SMTP; 12 Mar 2013 00:15:36 +0100 X-Authenticated: #19296480 X-Provags-ID: V01U2FsdGVkX1/1BVdhV5z1hQSm5VsUmE0J1Cc1khtUZth5aiWK4J +k0wlkhW0/fTt5 Original-Received: from grfz by boo.workgroup with local (Exim 4.80) (envelope-from ) id 1UFBvv-0005Js-Dw; Tue, 12 Mar 2013 00:15:07 +0100 Mail-Followup-To: help-gnu-emacs Content-Disposition: inline In-Reply-To: <83ehfmx5xz.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.18 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:89477 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? Ciao, Gregor -- -... --- .-. . -.. ..--.. ...-.-