[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add notifications.el
From: |
Julien Danjou |
Subject: |
Re: [PATCH] Add notifications.el |
Date: |
Wed, 09 Jun 2010 21:47:47 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
On Wed, Jun 09 2010, Tassilo Horn wrote:
> (defvar th-notify-body-to-id-map (make-hash-table :test 'string=)
> "Maps BODY values of notifications to the last notification ID.
> If ID is -1, then any further notifications with that body will
> be skipped.")
>
> (defun th-notify (&rest args)
> "Create a notification popup.
> For ARGS, see `notifications-notify'.
> If there was a notification with the same BODY before, that one
> will be replaced by the current notification."
> (require 'notifications)
> (let* ((body (plist-get args :body))
> (replace-id (or (gethash body th-notify-body-to-id-map)
> (plist-get args :replaces-id))))
> (unless (eql replace-id -1)
> (puthash
> body
> (apply 'notifications-notify
> (plist-put (plist-put args :replaces-id replace-id)
> :timeout 0))
> th-notify-body-to-id-map))))
What about adding:
:on-close
`(lambda (reason)
(when (eq reason 'dismissed)
(puthash ,body -1 th-notify-body-to-id-map)))
in `args' ?
--
Julien Danjou
// ᐰ <address@hidden> http://julien.danjou.info
pgp0HVYKvAWZA.pgp
Description: PGP signature
- Re: [PATCH] Add notifications.el, (continued)
- Re: [PATCH] Add notifications.el, Julien Danjou, 2010/06/11
- Message not available
- Re: [PATCH] Add notifications.el, Jan Moringen, 2010/06/11
- Re: [PATCH] Add notifications.el, Julien Danjou, 2010/06/11
- Re: [PATCH] Add notifications.el, Michael Albinus, 2010/06/11
- Re: [PATCH] Add notifications.el, Jan Moringen, 2010/06/11
- Re: [PATCH] Add notifications.el, Stefan Monnier, 2010/06/08
- Re: [PATCH] Add notifications.el, Michael Albinus, 2010/06/09
Re: [PATCH] Add notifications.el, Tassilo Horn, 2010/06/09
- Re: [PATCH] Add notifications.el, Julien Danjou, 2010/06/09
- Re: [PATCH] Add notifications.el, Tassilo Horn, 2010/06/09
- Re: [PATCH] Add notifications.el,
Julien Danjou <=
- Re: [PATCH] Add notifications.el, Tassilo Horn, 2010/06/09
- Re: [PATCH] Add notifications.el, Stefan Monnier, 2010/06/09
- Re: [PATCH] Add notifications.el, Julien Danjou, 2010/06/09
- Re: [PATCH] Add notifications.el, Stefan Monnier, 2010/06/09
- Re: [PATCH] Add notifications.el, Tassilo Horn, 2010/06/10
- Re: [PATCH] Add notifications.el, Julien Danjou, 2010/06/10
- Re: [PATCH] Add notifications.el, Michael Albinus, 2010/06/10
- [PATCH] Passes notification id as argument of on-action and on-close functions, Julien Danjou, 2010/06/10
- Re: [PATCH] Passes notification id as argument of on-action and on-close functions, Michael Albinus, 2010/06/10
- Re: [PATCH] Passes notification id as argument of on-action and on-close functions, Julien Danjou, 2010/06/10