Create the eshell-command-alert helper
This commit is contained in:
parent
bf4d26c1e3
commit
ae016f9db4
@ -1030,6 +1030,20 @@ Function to bind it locally to =C-d=.
|
||||
(local-set-key (kbd "C-d") #'eshell-C-d))
|
||||
#+end_src
|
||||
|
||||
This sends an alert when an eshell command is finished. Taken from
|
||||
[[https://blog.hoetzel.info/post/eshell-notifications/][here]].
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun eshell-command-alert (process status)
|
||||
"Send `alert' with severity based on STATUS when PROCESS finished."
|
||||
(let* ((cmd (process-command process))
|
||||
(buffer (process-buffer process))
|
||||
(msg (format "%s: %s" (mapconcat 'identity cmd " ") status)))
|
||||
(if (string-prefix-p "finished" status)
|
||||
(alert msg :buffer buffer :severity 'normal)
|
||||
(alert msg :buffer buffer :severity 'urgent))))
|
||||
#+end_src
|
||||
|
||||
Now set up eshell.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
|
Loading…
x
Reference in New Issue
Block a user