From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathieu Poussin Newsgroups: gmane.emacs.help Subject: ERC: Gets buffer/channel name in erc-text-matched-hook ? Date: Thu, 21 May 2015 18:17:58 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1432247347 8052 80.91.229.3 (21 May 2015 22:29:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 May 2015 22:29:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 22 00:29:00 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YvYxY-00043j-CU for geh-help-gnu-emacs@m.gmane.org; Fri, 22 May 2015 00:29:00 +0200 Original-Received: from localhost ([::1]:59710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvYxX-0000Y9-Pe for geh-help-gnu-emacs@m.gmane.org; Thu, 21 May 2015 18:28:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvTAa-0008JP-OQ for help-gnu-emacs@gnu.org; Thu, 21 May 2015 12:18:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YvTAW-0003ln-KX for help-gnu-emacs@gnu.org; Thu, 21 May 2015 12:18:04 -0400 Original-Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:38674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YvTAW-0003lU-8O for help-gnu-emacs@gnu.org; Thu, 21 May 2015 12:18:00 -0400 Original-Received: by wichy4 with SMTP id hy4so19739768wic.1 for ; Thu, 21 May 2015 09:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netyxia.net; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=BWwD9WKwMlw3d1x2wkCROyTbxXTC/c7to80Oy8sN8Qw=; b=dLsxG24pRJJ1rIxkFguZI7zsgSZfrcAMJyXIm94sWd3HR80H5YMgHyAElI1KYYH+y8 uAy0udKi/mLps0cJCMxFRGd8XHUwn3XMKjYSsNnYzvPPu9FN8dm/Qznt3PNS0eUfsxK/ FU8jYh+DsM/tj5mAS3k1FfGh4VngrD3ZvxeSY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=BWwD9WKwMlw3d1x2wkCROyTbxXTC/c7to80Oy8sN8Qw=; b=KcpefpYPXmizSUKtCjg5BNGvwtrT+TwpW0U53bbVxL8vOzx4T3ocYb04DjuyCrIB6Z tpFmn6YEq3aRZ3pVvsJtqhrj/cFJ4s1g52MVbAanoq/jWh94ENFtMGLp7Q4NwDmFoN0G j7M9fo9ENlTKNFroXxQml5N3ijig07Kbo+saXVVgAq99Ay5Cazed5AuqvTCbE/Gwt/Yz ERVzaK3ALCsiJ78XvY13zowRwXXRsnO8wt4yHjFILJaojWEQ1YjuUOfnZlhOX7BTEihC KSafXK6Ve+wiTUiB3e7R4uGG4xx79NhgoZEDCXIAi7zE6/mFjie0WSCMX8PGZdc8Oe1n PCjg== X-Gm-Message-State: ALoCoQnFXiL3XNzWLH8X3JkEkiZ6S+Ij83aQXcxHY8YtIawI2BLUMRhlK9eJirfgs7FaV/s5S3KU X-Received: by 10.180.94.39 with SMTP id cz7mr52239437wib.66.1432225078818; Thu, 21 May 2015 09:17:58 -0700 (PDT) Original-Received: by 10.28.26.204 with HTTP; Thu, 21 May 2015 09:17:58 -0700 (PDT) X-Originating-IP: [91.208.181.161] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::232 X-Mailman-Approved-At: Thu, 21 May 2015 18:28:43 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104516 Archived-At: Hello, I wrote a simple system that send me a notification using pushover and shows the revelant line in emacs. Currently I get the nick and message, I would like to include the buffer name / channel name in the notification message, but I don't know how can I do this. Here is my code : (defcustom pushover-token nil "pushover application token") (defcustom pushover-user-key nil "pushover user-key") (defun pushover-notify (title msg) (let ((url-request-method "POST") (url-request-data (concat "token=" pushover-token "&user=" pushover-user-key "&title=" title "&message=" msg))) (url-retrieve "https://api.pushover.net/1/messages.json" 'pushover-kill-url-buffer))) (defun pushover-kill-url-buffer (status) "Kill the buffer returned by `url-retrieve'." (kill-buffer (current-buffer))) ;; Notify my when someone mentions my nick. (defun erc-global-notify (matched-type nick msg) (interactive) (when (eq matched-type 'current-nick) (pushover-notify "ERC Notification" (concat "<" (car (split-string nick "!")) "> " message)) (display-message-or-buffer (concat "<" (car (split-string nick "!")) "> " message) "ERC Notifications") )) (add-hook 'erc-text-matched-hook 'erc-global-notify) How can I do this ? Thank you.