 		 nil nil "pgrep" nil nil nil "mu") 0)
       (danylo/get-mail))
     ;; Clean up by killing the mu4e process that got created
-    (run-with-timer danylo/get-mail-min-interval nil
-		    (lambda () (danylo/kill-mu4e)))
+    (unless stay
+      (run-with-timer danylo/get-mail-min-interval nil
+		      (lambda () (danylo/kill-mu4e))))
     ))
 
 (with-eval-after-load "mu4e"

  (interactive "P")
  (if arg (mu4e-quit)
    (progn
      (danylo/email-bg-refresh)
      (mu4e))))

(general-define-key

       (ignore-errors (signal-process proc 'SIGINT))))
   (process-list)))

(defun danylo/email-bg-refresh (&optional stay)
  "Refresh the inbox in the background. This function does nothing
if a mu4e is currently visible in any frame. I judge that it is
dangerous then to kill the mu4e process, as it might be used by
something important that the user is currently doing.

If STAY is not nil, then do not kill the mu4e process created
when getting mail."
  (interactive)
  ;; Check if any mu4e buffers are open
  (setq danylo/mu4e~is~active nil)
