emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] erc-desktop-notification include channel name


From: Alberto Donato
Subject: [PATCH] erc-desktop-notification include channel name
Date: Mon, 29 May 2017 12:36:11 +0200

Optionally include the channel name for ERC notifications.

diff --git a/lisp/erc/erc-desktop-notifications.el
b/lisp/erc/erc-desktop-notifications.el
index 113f1cf..8f18bed 100644
--- a/lisp/erc/erc-desktop-notifications.el
+++ b/lisp/erc/erc-desktop-notifications.el
@@ -52,6 +52,11 @@
   :group 'erc-notifications
   :type '(choice (const :tag "Session bus" :session) string))

+(defcustom erc-notifications-include-channel nil
+  "Include channel name in notifications."
+  :group 'erc-notifications
+  :type 'bool)
+
 (defvar dbus-debug) ; used in the macroexpansion of dbus-ignore-errors

 (defun erc-notifications-notify (nick msg)
@@ -83,6 +88,8 @@ This will replace the last notification sent with
this function."
       (unless (or (string-match-p "^Server:" nick)
                   (when (boundp 'erc-track-exclude)
                     (member nick erc-track-exclude)))
+        (when erc-notifications-include-channel
+          (setq nick (format "%s (%s)" nick (buffer-name))))
         (erc-notifications-notify nick msg)))))

 ;;;###autoload(autoload 'erc-notifications-mode
"erc-desktop-notifications" "" t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]