help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why 4 inotfy events when saving a file?


From: B. T. Raven
Subject: Re: why 4 inotfy events when saving a file?
Date: Mon, 11 Mar 2013 21:21:14 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1


> Hi Eli, Emacs users and developers,
> * Eli Zaretskii <eliz@gnu.org> [11. Mar. 2013]:
>>> Date: Sun, 10 Mar 2013 22:44:42 +0100
>>> From: Gregor Zattler <telegraph@gmx.net>
>>>
>>> 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
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]