58
58
59
59
(defcustom haskell-notify-p
60
60
nil
61
- " Notify using notify .el (if loaded)?"
61
+ " Notify using notifications .el (if loaded)?"
62
62
:type 'boolean
63
63
:group 'haskell )
64
64
@@ -102,6 +102,10 @@ has changed?"
102
102
103
103
(defvar haskell-process-prompt-regex " \\ (^[> ]*> $\\ |\n [> ]*> $\\ )" )
104
104
105
+ (defconst haskell-process-logo
106
+ (file-truename " logo.svg" )
107
+ " Haskell logo for notifications." )
108
+
105
109
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
106
110
; ; Specialised commands
107
111
@@ -231,7 +235,7 @@ changed. Restarts the process if that is the case."
231
235
(let ((process (haskell-process)))
232
236
(haskell-process-queue-command
233
237
process
234
- (haskell-command-make
238
+ (haskell-command-make
235
239
(list session process command)
236
240
(lambda (state )
237
241
(haskell-process-send-string (cadr state)
@@ -293,9 +297,15 @@ changed. Restarts the process if that is the case."
293
297
(haskell-interactive-mode-echo session msg)
294
298
(haskell-mode-message-line msg)
295
299
(when (and haskell-notify-p
296
- (fboundp 'notify ))
297
- (notify (format " *%s * " (haskell-session-name (car state)))
298
- msg)))))))))
300
+ (fboundp 'notifications-notify ))
301
+ (notifications-notify
302
+ :title (format " *%s * " (haskell-session-name (car state)))
303
+ :body msg
304
+ :app-name (ecase haskell-process-type
305
+ ('ghci " cabal" )
306
+ ('cabal-dev " cabal-dev" ))
307
+ :app-icon haskell-process-logo
308
+ )))))))))
299
309
300
310
(defun haskell-process-cabal-live (state buffer )
301
311
" Do live updates for Cabal processes."
@@ -378,7 +388,7 @@ changed. Restarts the process if that is the case."
378
388
(line (string-to-number (match-string 2 buffer)))
379
389
(col (match-string 3 buffer))
380
390
(warning (string-match " ^Warning: " error-msg))
381
- (final-msg (format " %s :%s :%s : %s "
391
+ (final-msg (format " %s :%s :%s : %s "
382
392
(haskell-session-strip-dir session file)
383
393
line
384
394
col
@@ -461,7 +471,7 @@ changed. Restarts the process if that is the case."
461
471
(haskell-process-set-process
462
472
process
463
473
(ecase haskell-process-type
464
- ('ghci
474
+ ('ghci
465
475
(haskell-process-log (format " Starting inferior GHCi process %s ... "
466
476
haskell-process-path-ghci))
467
477
(start-process (haskell-session-name session)
@@ -754,7 +764,7 @@ changed. Restarts the process if that is the case."
754
764
(when x
755
765
(cdr x))))
756
766
757
- (defun haskell-process-set (s key value )
767
+ (defun haskell-process-set (s key value )
758
768
" Set the process's `key' ."
759
769
(delete-if (lambda (prop ) (equal (car prop) key)) s)
760
770
(setf (cdr s) (cons (cons key value)
@@ -776,7 +786,7 @@ changed. Restarts the process if that is the case."
776
786
" Call the command's go function."
777
787
(let ((func (haskell-command-get s 'go )))
778
788
(when func
779
- (funcall func
789
+ (funcall func
780
790
(haskell-command-state s)))))
781
791
782
792
(defun haskell-command-complete (s response )
@@ -791,7 +801,7 @@ changed. Restarts the process if that is the case."
791
801
" Trigger the command's live updates callback."
792
802
(let ((func (haskell-command-get s 'live )))
793
803
(when func
794
- (funcall func
804
+ (funcall func
795
805
(haskell-command-state s)
796
806
response))))
797
807
@@ -801,7 +811,7 @@ changed. Restarts the process if that is the case."
801
811
(when x
802
812
(cdr x))))
803
813
804
- (defun haskell-command-set (s key value )
814
+ (defun haskell-command-set (s key value )
805
815
" Set the command's `key' ."
806
816
(delete-if (lambda (prop ) (equal (car prop) key)) s)
807
817
(setf (cdr s) (cons (cons key value)
0 commit comments