=cl-letf= instead of the now obsolete =flet=.
#+begin_src emacs-lisp
-(use-package compile
- :config
+(with-eval-after-load 'compile
(defun amin--compilation-finish-function (buffer outstr)
(unless (string-match "finished" outstr)
(switch-to-buffer-other-window buffer))