erc-discuss
[Top][All Lists]
Advanced

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

Re: [Erc-discuss] [PATCH] erc-desktop-notification include channel name


From: Alberto Donato
Subject: Re: [Erc-discuss] [PATCH] erc-desktop-notification include channel name
Date: Wed, 25 Oct 2017 18:16:26 +0200

Is this the right place to submit patches?
Should I file a PR on https://github.com/emacs-mirror/emacs instead?

On Tue, Aug 8, 2017 at 5:49 PM, Alberto Donato <address@hidden> wrote:
This adds an option to include the channel name in 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]