feat(emacs): add status icons to compilation notification

When the compilation notification displays it will now show an icon with the
result of the compilation.
This commit is contained in:
Ade Attwood 2022-04-09 07:50:34 +01:00
parent a28ec75358
commit 5d825446cc

View file

@ -139,13 +139,17 @@
(global-aa-tab-mode) (global-aa-tab-mode)
;; https://people.gnome.org/~federico/blog/compilation-notifications-in-emacs.html ;; https://people.gnome.org/~federico/blog/compilation-notifications-in-emacs.html
;; (setq compilation-finish-functions
;; (append compilation-finish-functions
;; '(fmq-compilation-finish)))
(setq compilation-finish-functions (setq compilation-finish-functions
(append compilation-finish-functions '(fmq-compilation-finish))
'(fmq-compilation-finish)))
(defun fmq-compilation-finish (buffer status) (defun fmq-compilation-finish (buffer status)
(print status)
(call-process "notify-send" nil nil nil (call-process "notify-send" nil nil nil
"-t" "30000" ;; Display notification for 30 seconds "-t" "30000" ;; Display notification for 30 seconds
"-i" "emacs" "-i" (if (string-match "^finished" status) "dialog-ok" "dialog-no")
"Compilation finished in Emacs" "Compilation finished in Emacs"
status)) status))