<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>A Random String of Bits &#187; emacs</title>
	<atom:link href="http://stringofbits.net/tag/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://stringofbits.net</link>
	<description>Sequences of bytes about Technology, Programming, Gaming, Doctor Who, and more</description>
	<lastBuildDate>Sat, 28 Jan 2012 12:06:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='stringofbits.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>A Random String of Bits &#187; emacs</title>
		<link>http://stringofbits.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://stringofbits.net/osd.xml" title="A Random String of Bits" />
	<atom:link rel='hub' href='http://stringofbits.net/?pushpress=hub'/>
		<item>
		<title>emacs 23, dbus, and libnotify</title>
		<link>http://stringofbits.net/2009/08/31/emacs-23-dbus-and-libnotify/</link>
		<comments>http://stringofbits.net/2009/08/31/emacs-23-dbus-and-libnotify/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 03:47:44 +0000</pubDate>
		<dc:creator>Anna Wiggins</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://stringofbits.net/?p=166</guid>
		<description><![CDATA[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" ; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stringofbits.net&amp;blog=23443234&amp;post=166&amp;subd=stringofbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A new major version of <a href="http://www.gnu.org/software/emacs/">emacs</a> is out, and it includes dbus support.  This is great, because it means we can do things like this:</p>
<blockquote><pre>
(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)
</pre>
</blockquote>
<p>Add this to your .emacs file and you will receive a libnotify popup when M-x compile completes.  It will even give you the exit message, so you know whether the compile was successful.</p>
<p>So now you can let that long compile run, and work on <a href="http://xkcd.com/303/">something else</a>.  emacs will let you know when the compile finishes.</p>
<p>As written above, the notifications will stay on your screen until you dismiss them (by clicking on them).  If you would like them to vanish after a preset time limit, change the 0 in the call to send-desktop-notification.  Set it to the number of milliseconds the popup should remain on the screen.</p>
<div id="attachment_173" class="wp-caption alignright" style="width: 310px"><a href="http://stringofbits.files.wordpress.com/2009/08/compile_bad1.png"><img src="http://stringofbits.files.wordpress.com/2009/08/compile_bad1.png?w=300&#038;h=99" alt="Screenshot of libnotify popup showing a compiler error" title="compile_bad" width="300" height="99" class="size-medium wp-image-173" /></a><p class="wp-caption-text">Screenshot of libnotify popup showing a compiler error</p></div>
<p>This is just the tip of the iceberg, of course.  Any application that presents a dbus interface can be interacted with from emacs, which means that emacs can also integrate itself with the Linux desktop in <a href="http://emacs-fu.blogspot.com/2009/01/using-d-bus-example.html">other interesting ways</a>.</p>
<br />Posted in Technology Tagged: emacs, programming <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stringofbits.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stringofbits.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stringofbits.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stringofbits.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stringofbits.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stringofbits.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stringofbits.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stringofbits.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stringofbits.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stringofbits.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stringofbits.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stringofbits.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stringofbits.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stringofbits.wordpress.com/166/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stringofbits.net&amp;blog=23443234&amp;post=166&amp;subd=stringofbits&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stringofbits.net/2009/08/31/emacs-23-dbus-and-libnotify/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a6c6c99ccd3e2bbaec318a52fb3d43c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">annabunches</media:title>
		</media:content>

		<media:content url="http://stringofbits.files.wordpress.com/2009/08/compile_bad1.png?w=300" medium="image">
			<media:title type="html">compile_bad</media:title>
		</media:content>
	</item>
	</channel>
</rss>
