---
deprecated: true
excerpt_separator:
category: technology
layout: post
title: emacs 23, dbus, and libnotify
date: '2009-08-31T18:47:00.000-04:00'
author: Anna Wiggins
tags:
- emacs
- programming
- Technology
modified_time: '2013-10-22T11:19:50.826-04:00'
blogger_id: tag:blogger.com,1999:blog-4209116010564764361.post-6878792725228849848
blogger_orig_url: http://www.stringofbits.net/2009/08/emacs-23-dbus-and-libnotify.html
---
A new major version of emacs is out, and it includes dbus support. This is great, because it means we can do things like this:
(require 'dbus)
(defun send-desktop-notification (summary body timeout)
"call notification-daemon method METHOD with ARGS over dbus"
(dbus-call-method
:session ; use the session (not system) bus
"org.freedesktop.Notifications" ; service name
"/org/freedesktop/Notifications" ; path name
"org.freedesktop.Notifications" "Notify" ; Method
"emacs"
0
""
summary
body
'(:array)
'(:array :signature "{sv}")
':int32 timeout))
(defun pw/compile-notify (buffer message)
(send-desktop-notification "emacs compile" message 0))
(setq compilation-finish-function 'pw/compile-notify)