我在 emacs 24 中使用 ERC,并在我的.emacs
. 该erc-global-notify
函数改编自http://www.emacswiki.org/emacs/ErcPageMe。不幸的是,当最小化带有 erc windows 的 emacs 时,我无法从 dbus 收到任何通知。它有什么问题?
(require 'erc-match)
(erc-match-mode t)
(setq erc-keywords '("c++" "python" "emacs" "i")
erc-pals '("ij" "yy" "xx"))
(require 'notifications)
(defun erc-global-notify (match-type nick message)
"Notify when someone sends a message that matches a regexp in `erc-keywords'."
(when (and (eq match-type 'keyword)
;; I don't want to see anything from the erc server
(null (string-match "^[sS]erver" nick))
;; or bots
(null (string-match "\\(bot\\|serv\\)!" nick)))
(notifications-notify
:title nick
:body message
:urgency 'normal)))
(add-hook 'erc-text-matched-hook 'erc-global-notify)