In my old emacs, I have defined the following code.
(add-hook 'focus-out-hook (lambda () (save-some-buffers t)))
After upgrade to emacs 27, it said focus-out-hook is obsoleted, and the new one is after-focus-change-function, but simply replace it doesn't work. The following doesn't work
(add-hook 'after-focus-change-function (lambda () (save-some-buffers t)))
Looks to me the first is a hook, so need to use add-hook, but for the new function to work, how to use it? My purpose is to save a buffer after I switch to another app.