summaryrefslogtreecommitdiffhomepage
path: root/lib/eos/jao-notify.el
diff options
context:
space:
mode:
Diffstat (limited to 'lib/eos/jao-notify.el')
-rw-r--r--lib/eos/jao-notify.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/eos/jao-notify.el b/lib/eos/jao-notify.el
index dc48ca4..5e7e627 100644
--- a/lib/eos/jao-notify.el
+++ b/lib/eos/jao-notify.el
@@ -1,6 +1,6 @@
;; jao-notify.el -- Interacting with notification daemon
-;; Copyright (c) 2017, 2019, 2020 Jose Antonio Ortega Ruiz
+;; Copyright (c) 2017, 2019, 2020, 2021 Jose Antonio Ortega Ruiz
;; Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
;; Start date: Sun Jan 08, 2017 20:24
@@ -18,15 +18,16 @@
(declare-function notifications-notify "notifications")
(defun jao-notify (msg &optional title icon)
- (if jao-notify-use-messages-p
- (message "%s%s%s" (or title "") (if title ": " "") (or msg ""))
+ (let ((title (when (and title (not (string-blank-p title))) title)))
+ (if jao-notify-use-messages-p
+ (message "%s%s%s" (or title "") (if title ": " "") (or msg ""))
(let* ((args `(:timeout ,jao-notify-timeout))
(args (append args
(if title `(:title ,title :body ,msg) `(:title ,msg))))
(args (if (and (stringp icon) (file-exists-p icon))
(append args `(:app-icon ,(format "%s" icon)))
args)))
- (apply 'notifications-notify args))))
+ (apply 'notifications-notify args)))))
(provide 'jao-notify)