Subject: bug#25340: Save-some-buffers gets called when installing packages.

From: Andreas Politz <[email-masked]>
Date: Sat, 04 Mar 2017 12:25:12 +0100

Also, what about excluding non-Lisp files.

#+BEGIN_SRC emacs-lisp
  (lambda ()
    ;; Assuming (buffer-file-name) is always non-nil.
    (string-match-p emacs-lisp-file-regexp (buffer-file-name))
    (file-in-directory-p (buffer-file-name) directory))
#+END_SRC

I thing, the string-match-p part could also be used unconditionally.

-ap