Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Show channel name in ERC notification
diff --git a/lisp/erc/erc-desktop-notifications.el b/lisp/erc/erc-desktop-notifications.el
index 84db0f58e46d..2978f6362279 100644
--- a/lisp/erc/erc-desktop-notifications.el
+++ b/lisp/erc/erc-desktop-notifications.el
@@ -52,11 +52,18 @@
:group 'erc-notifications
:type '(choice (const :tag "Session bus" :session) string))
+(defcustom erc-notifications-show-channel nil
+ "Show channel name in notification."
+ :group 'erc-notifications
+ :type 'boolean)
+
(defvar dbus-debug) ; used in the macroexpansion of dbus-ignore-errors
(defun erc-notifications-notify (nick msg)
"Notify that NICK send some MSG.
This will replace the last notification sent with this function."
+ (if erc-notifications-show-channel
+ (setq nick (format "%s (%s)" nick (buffer-name))))
(dbus-ignore-errors
(setq erc-notifications-last-notification
(notifications-notify :bus erc-notifications-bus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment