This question is inspired by https://emacs.stackexchange.com/a/5947/.
Assume that I have a function like
(defun do-some-actions () () (..put a copy of the current file in a specific folder...) )
And I would like that the above function to be run after saving files. The following hook can do the job:
(add-hook 'after-save-hook 'do-some-actions)
But in this way Emacs runs the function
do-some-action even for the files which have not been manually saved. For instance when I install the packages via Melpa, Emacs itself saves some files with the name
package_name-autoloads.el in the directory
~/.emacs.d/elpa/package_name/ and even though these files have not been saved manually, the function
do-some-actions is executed.
My question is about the possibility to prevent Emacs to this after-save-hook when the file has not been saved manually.