<?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>Tassilo's Blog</title>
	<atom:link href="http://tsdh.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tsdh.wordpress.com</link>
	<description>The personal blog of Tassilo Horn</description>
	<lastBuildDate>Wed, 07 Oct 2009 19:12:50 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='tsdh.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/5c31de91f2330df8ad945bca02a56044?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Tassilo's Blog</title>
		<link>http://tsdh.wordpress.com</link>
	</image>
			<item>
		<title>Integrating Emacs&#8217; org-mode with the Awesome window manager</title>
		<link>http://tsdh.wordpress.com/2009/03/04/integrating-emacs-org-mode-with-the-awesome-window-manager/</link>
		<comments>http://tsdh.wordpress.com/2009/03/04/integrating-emacs-org-mode-with-the-awesome-window-manager/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 20:06:32 +0000</pubDate>
		<dc:creator>Tassilo Horn</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[awesome]]></category>
		<category><![CDATA[org-mode]]></category>

		<guid isPermaLink="false">http://tsdh.wordpress.com/?p=55</guid>
		<description><![CDATA[I&#8217;ve switched to another tiling window manager called awesome and it&#8217;s really like its name suggests.  It&#8217;s more a window manager framework that can be programmed in lua to create a window manager that does exactly what you want it to do.
Awesome has a lua library called naughty for displaying notifications. Now my idea [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=55&subd=tsdh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve switched to another tiling window manager called <a href="http://awesome.naquadah.org/">awesome</a> and it&#8217;s really like its name suggests.  It&#8217;s more a window manager framework that can be programmed in <a href="http://www.lua.org/">lua</a> to create a window manager that does exactly what you want it to do.</p>
<p>Awesome has a lua library called <a href="http://awesome.naquadah.org/apidoc/modules/naughty.html">naughty</a> for displaying notifications. Now my idea was that whenever my mouse pointer enters the region of the <a href="http://awesome.naquadah.org/apidoc/modules/capi.html#textbox">textbox</a> widget that shows the current date and time in a <a href="http://awesome.naquadah.org/apidoc/modules/capi.html#wibox">wibox</a>, a popup should show the agenda for this week and dispose automatically when I move the mouse away.</p>
<p>Ok, so here&#8217;s the code on the emacs side.  It assures that the file <tt>/tmp/org-agenda.txt</tt> always contains a plain-text export of the current org agenda.  It&#8217;s created once on emacs startup and after each change to any org agenda file it&#8217;ll be updated.</p>
<pre><code>;; update agenda file after changes to org files
(defun th-org-mode-init ()
  (add-hook 'after-save-hook 'th-org-update-agenda-file t t))

(add-hook 'org-mode-hook 'th-org-mode-init)

;; that's the export function
(defun th-org-update-agenda-file (&amp;optional force)
  (interactive)
  (save-excursion
    (save-window-excursion
      (let ((file "/tmp/org-agenda.txt"))
        (org-agenda-list)
        (org-write-agenda file)))))

;; do it once at startup
(th-org-update-agenda-file t)</code></pre>
<p>And here&#8217;s the lua code on the awesome side:</p>
<pre><code>-- the current agenda popup
org_agenda_pupup = nil

-- do some highlighting and show the popup
function show_org_agenda ()
   local fd = io.open("/tmp/org-agenda.txt", "r")
   if not fd then
      return
   end
   local text = fd:read("*a")
   fd:close()
   -- highlight week agenda line
   text = text:gsub("(Week%-agenda[ ]+%(W%d%d?%):)", "<span><u>%1</u></span>")
   -- highlight dates
   text = text:gsub("(%w+[ ]+%d%d? %w+ %d%d%d%d[^n]*)", "<span>%1</span>")
   -- highlight times
   text = text:gsub("(%d%d?:%d%d)", "<span>%1</span>")
   -- highlight tags
   text = text:gsub("(:[^ ]+:)([ ]*n)", "<span>%1</span>%2")
   -- highlight TODOs
   text = text:gsub("(TODO) ", "<span><b>%1</b></span> ")
   -- highlight categories
   text = text:gsub("([ ]+%w+:) ", "<span>%1</span> ")
   org_agenda_pupup = naughty.notify(
      { text     = text,
        timeout  = 999999999,
        width    = 600,
        position = "bottom_right",
        screen   = mouse.screen })
end

-- dispose the popup
function dispose_org_agenda ()
   if org_agenda_pupup ~= nil then
      naughty.destroy(org_agenda_pupup)
      org_agenda_pupup = nil
   end
end

mydatebox = widget({ type = "textbox", align = "right" }) -- shows the date
mydatebox.mouse_enter = show_org_agenda
mydatebox.mouse_leave = dispose_org_agenda

-- after that the mydatebox is added to some wibox, of course...</code></pre>
<p>And that&#8217;s how it looks like.</p>
<div id="attachment_58" class="wp-caption alignnone" style="width: 510px"><a href="http://www.flickr.com/photos/tsdh/3328356025/"><img src="http://tsdh.files.wordpress.com/2009/03/org-awesome.png?w=500&#038;h=315" alt="The Org Agenda in an Awesome/Naughty popup" title="org-awesome" width="500" height="315" class="size-full wp-image-58" /></a><p class="wp-caption-text">The Org Agenda in an Awesome/Naughty popup</p></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tsdh.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tsdh.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tsdh.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tsdh.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tsdh.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tsdh.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tsdh.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tsdh.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tsdh.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tsdh.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=55&subd=tsdh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tsdh.wordpress.com/2009/03/04/integrating-emacs-org-mode-with-the-awesome-window-manager/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9a009f0bee1ee8c91fc63463c4ea5463?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">tsdh</media:title>
		</media:content>

		<media:content url="http://tsdh.files.wordpress.com/2009/03/org-awesome.png" medium="image">
			<media:title type="html">org-awesome</media:title>
		</media:content>
	</item>
		<item>
		<title>Calling org-remember from inside conkeror</title>
		<link>http://tsdh.wordpress.com/2008/11/14/calling-org-remember-from-inside-conkeror/</link>
		<comments>http://tsdh.wordpress.com/2008/11/14/calling-org-remember-from-inside-conkeror/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 11:30:48 +0000</pubDate>
		<dc:creator>Tassilo Horn</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[conkeror]]></category>
		<category><![CDATA[org]]></category>
		<category><![CDATA[org-mode]]></category>
		<category><![CDATA[org-remember]]></category>
		<category><![CDATA[remember]]></category>

		<guid isPermaLink="false">http://tsdh.wordpress.com/?p=51</guid>
		<description><![CDATA[I use Carsten Dominik&#8217;s great emacs package org-mode for project planning, appointments and TODOs (org-mode homepage).  One cool feature is that it integrates nicely with the remember package.  So when an idea comes into my mind I need to remember for later, I hit M-x org-remember RET which presents me a buffer with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=51&subd=tsdh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I use Carsten Dominik&#8217;s great emacs package <em>org-mode</em> for project planning, appointments and TODOs (<a href="http://orgmode.org/">org-mode homepage</a>).  One cool feature is that it integrates nicely with the <em>remember</em> package.  So when an idea comes into my mind I need to remember for later, I hit <tt>M-x org-remember RET</tt> which presents me a buffer with a custom template, I type my note and hit <tt>C-c C-c</tt>.  The note is filed then and the buffer is gone, so there&#8217;s really no interruption.</p>
<p>One cool thing is that org-remember automatically inserts a link to the &#8220;thing&#8221; you had open when adding the note.  This &#8220;thing&#8221; could be a info buffer, a mail, a usenet article, an image,&#8230;</p>
<p>I thought it would be nice to use that facility to make TODO-bookmarks like &#8220;TODO read that great blog entry!&#8221; from inside my browser <a href="http://conkeror.org/">conkeror</a>.  And so I did.</p>
<p>Here&#8217;s the emacs side of the code (put it in your <tt>~/.emacs</tt>):</p>
<pre><code>(defun th-org-remember-conkeror (url)
  (interactive "s")
  (org-remember nil ?t)
  (save-excursion
    (insert "\n\n  [[" url "]]"))
  (local-set-key (kbd "C-c C-c")
         (lambda ()
           (interactive)
           (org-ctrl-c-ctrl-c)
           (delete-frame nil t))))</code></pre>
<p>And that&#8217;s the conkeror side (put it in your <tt>~/.conkerorrc</tt>):</p>
<pre><code>function org_remember(url, window) {
    var cmd_str = 'emacsclient -c --eval \'(th-org-remember-conkeror "' + url + '")\'';
    if (window != null) {
    window.minibuffer.message('Issuing ' + cmd_str);
    }
    shell_command_blind(cmd_str);
}

interactive("org-remember", "Remember the current url with org-remember",
        function (I) {
        org_remember(I.buffer.display_URI_string, I.window);
        });</code></pre>
<p>This code may require emacs 23, I&#8217;m not too sure.  What you need in every case is a running emacs server, so that you can connect to it with <tt>emacsclient</tt>.</p>
<p><strong>UPDATE: Now I use org-protocol instead of something home-brewn.</strong></p>
<p>Here&#8217;s the updated code for your <tt>~/.conkerorrc</tt>.  On the emacs side nothing is needed anymore.</p>
<pre><code>function org_remember(url, title, text, window) {
    var eurl = encodeURIComponent(url);
    var etitle = encodeURIComponent(title);
    var etext = encodeURIComponent(text);
    var cmd_str = "emacsclient -c org-protocol://remember://" + eurl + "/" + etitle + "/" + etext;
    window.minibuffer.message("Issuing " + cmd_str);
    shell_command_blind(cmd_str);
}

interactive("org-remember", "Remember the current url with org-remember",
        function (I) {
          org_remember(I.buffer.display_uri_string,
                       I.buffer.document.title,
                       I.buffer.top_frame.getSelection(),
                       I.window);
        });</code></pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tsdh.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tsdh.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tsdh.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tsdh.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tsdh.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tsdh.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tsdh.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tsdh.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tsdh.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tsdh.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=51&subd=tsdh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tsdh.wordpress.com/2008/11/14/calling-org-remember-from-inside-conkeror/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9a009f0bee1ee8c91fc63463c4ea5463?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">tsdh</media:title>
		</media:content>
	</item>
		<item>
		<title>Re-open read-only files as root automagically</title>
		<link>http://tsdh.wordpress.com/2008/08/20/re-open-read-only-files-as-root-automagically/</link>
		<comments>http://tsdh.wordpress.com/2008/08/20/re-open-read-only-files-as-root-automagically/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 19:54:09 +0000</pubDate>
		<dc:creator>Tassilo Horn</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[TRAMP]]></category>

		<guid isPermaLink="false">http://tsdh.wordpress.com/?p=43</guid>
		<description><![CDATA[I have my emacs running as server and two small wrapper scripts ec and et which connect to it with emacsclient (either creating a new frame or opening a terminal frame).
Because I want to do all my system administration (editing files in /etc/) with emacs and don&#8217;t want to start another emacs instance as root, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=43&subd=tsdh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have my emacs running as server and two small wrapper scripts <tt>ec</tt> and <tt>et</tt> which connect to it with <tt>emacsclient</tt> (either creating a new frame or opening a terminal frame).</p>
<p>Because I want to do all my system administration (editing files in <tt>/etc/</tt>) with emacs and don&#8217;t want to start another emacs instance as root, I use TRAMP to switch to superuser mode automagically if the opened file is read-only.</p>
<p>Here&#8217;s the code (<span style="text-decoration:underline;"><span style="color:#ff0000;"><strong>UPDATED</strong></span></span>: Uses defadvice instead of hooking into find-file-hook, which had the bad effect of find-file-hook running twice.):</p>
<pre><code>(defun th-rename-tramp-buffer ()
  (when (file-remote-p (buffer-file-name))
    (rename-buffer
     (format "%s:%s"
             (file-remote-p (buffer-file-name) 'method)
             (buffer-name)))))

(add-hook 'find-file-hook
          'th-rename-tramp-buffer)

(defadvice find-file (around th-find-file activate)
  "Open FILENAME using tramp's sudo method if it's read-only."
  (if (and (not (file-writable-p (ad-get-arg 0)))
           (y-or-n-p (concat "File "
                             (ad-get-arg 0)
                             " is read-only.  Open it as root? ")))
      (th-find-file-sudo (ad-get-arg 0))
    ad-do-it))

(defun th-find-file-sudo (file)
  "Opens FILE with root privileges."
  (interactive "F")
  (set-buffer (find-file (concat "/sudo::" file))))</code></pre>
<p>Now whenever I type <tt>ec /some/file/i/have/no/permissions/to/write</tt> (or <tt>emacsclient [-c|-t] /some/root/file</tt>, emacs asks me to re-open it using TRAMP&#8217;s sudo method.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tsdh.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tsdh.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tsdh.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tsdh.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tsdh.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tsdh.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tsdh.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tsdh.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tsdh.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tsdh.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tsdh.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tsdh.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=43&subd=tsdh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tsdh.wordpress.com/2008/08/20/re-open-read-only-files-as-root-automagically/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9a009f0bee1ee8c91fc63463c4ea5463?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">tsdh</media:title>
		</media:content>
	</item>
		<item>
		<title>Some calendar and org-mode integration stuff</title>
		<link>http://tsdh.wordpress.com/2008/07/03/some-calendar-and-org-mode-integration-stuff/</link>
		<comments>http://tsdh.wordpress.com/2008/07/03/some-calendar-and-org-mode-integration-stuff/#comments</comments>
		<pubDate>Thu, 03 Jul 2008 20:00:53 +0000</pubDate>
		<dc:creator>Tassilo Horn</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[org-mode]]></category>

		<guid isPermaLink="false">http://tsdh.wordpress.com/?p=36</guid>
		<description><![CDATA[The following code binds RET in calendar mode to a function that opens an org agenda buffer for that day (or better that week).
(defun th-calendar-open-agenda ()
  (interactive)
  (let* ((calendar-date (or
                        [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=36&subd=tsdh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The following code binds RET in calendar mode to a function that opens an org agenda buffer for that day (or better that week).</p>
<pre><code>(defun th-calendar-open-agenda ()
  (interactive)
  (let* ((calendar-date (or
                         ;; the date at point in the calendar buffer
                         (calendar-cursor-to-date)
                         ;; if there's none, use the curren date
                         (calendar-current-date)))
         (day (time-to-days (encode-time 1 1 1
                                         (second calendar-date)
                                         (first calendar-date)
                                         (third calendar-date))))
         (calendar-buffer (current-buffer)))
    (org-agenda-list nil day)
    (select-window (get-buffer-window calendar-buffer))))

(define-key calendar-mode-map (kbd "RET") 'th-calendar-open-agenda)</code></pre>
<p>And here&#8217;s a small minor mode which uses the function above to refresh the agenda buffer when you move point in the calendar buffer, so calendar and agenda stay in sync.</p>
<pre><code>(define-minor-mode th-org-agenda-follow-calendar-mode
  "If enabled, each calendar movement will refresh the org agenda
buffer."
  :lighter " OrgAgendaFollow"
  (if (not (eq major-mode 'calendar-mode))
      (message "Cannot activate th-org-agenda-follow-calendar-mode in %s." major-mode)
    (if th-org-agenda-follow-calendar-mode
        (add-hook 'calendar-move-hook 'th-calendar-open-agenda)
      (remove-hook 'calendar-move-hook 'th-calendar-open-agenda))))

(add-hook 'calendar-mode-hook 'th-org-agenda-follow-calendar-mode)</code></pre>
<p>Another thing I added to calendar is the display of the week-of-year in the mode-line.</p>
<pre><code>(add-to-list 'calendar-mode-line-format
             '(let ((day (nth 1 date))
                    (month (nth 0 date))
                    (year (nth 2 date)))
                (format-time-string "Week of year: %V"
                                    (encode-time 1 1 1 day month year))))</code></pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tsdh.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tsdh.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tsdh.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tsdh.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tsdh.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tsdh.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tsdh.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tsdh.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tsdh.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tsdh.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tsdh.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tsdh.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=36&subd=tsdh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tsdh.wordpress.com/2008/07/03/some-calendar-and-org-mode-integration-stuff/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9a009f0bee1ee8c91fc63463c4ea5463?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">tsdh</media:title>
		</media:content>
	</item>
		<item>
		<title>My funky ZSH prompt</title>
		<link>http://tsdh.wordpress.com/2007/12/06/my-funky-zsh-prompt/</link>
		<comments>http://tsdh.wordpress.com/2007/12/06/my-funky-zsh-prompt/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 12:49:39 +0000</pubDate>
		<dc:creator>Tassilo Horn</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[ZSH]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://tsdh.wordpress.com/2007/12/06/my-funky-zsh-prompt/</guid>
		<description><![CDATA[Here&#8217;s the config for my ZSH prompt:
local blue_op="%{$fg[blue]%}[%{$reset_color%}"
local blue_cp="%{$fg[blue]%}]%{$reset_color%}"
local path_p="${blue_op}%~${blue_cp}"
local user_host="${blue_op}%n@%m${blue_cp}"
local ret_status="${blue_op}%?${blue_cp}"
local hist_no="${blue_op}%h${blue_cp}"
local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color%})"
PROMPT="╭─${path_p}─${user_host}─${ret_status}─${hist_no}
╰─${blue_op}${smiley}${blue_cp} %# "
local cur_cmd="${blue_op}%_${blue_cp}"
PROMPT2="${cur_cmd}&#62; "
It looks like this. 
It has two lines.  The first displays the path of the current working directory, then the user and hostname, then the return value of the last executed command, and the last item is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=35&subd=tsdh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s the config for my ZSH prompt:<br />
<code>local blue_op="%{$fg[blue]%}[%{$reset_color%}"<br />
local blue_cp="%{$fg[blue]%}]%{$reset_color%}"<br />
local path_p="${blue_op}%~${blue_cp}"<br />
local user_host="${blue_op}%n@%m${blue_cp}"<br />
local ret_status="${blue_op}%?${blue_cp}"<br />
local hist_no="${blue_op}%h${blue_cp}"<br />
local smiley="%(?,%{$fg[green]%}:%)%{$reset_color%},%{$fg[red]%}:(%{$reset_color%})"<br />
PROMPT="╭─${path_p}─${user_host}─${ret_status}─${hist_no}<br />
╰─${blue_op}${smiley}${blue_cp} %# "<br />
local cur_cmd="${blue_op}%_${blue_cp}"<br />
PROMPT2="${cur_cmd}&gt; "</code></p>
<p>It looks like this. <img src="http://www.tsdh.de/images/zsh-prompt.png" alt="ZSH prompt" /></p>
<p>It has two lines.  The first displays the path of the current working directory, then the user and hostname, then the return value of the last executed command, and the last item is the command&#8217;s number in the history.</p>
<p>The second line displays a green smiley, if the last command worked well, or a red smiley, if it failed.</p>
<p>I took some inspirations from the prompt of strcat, see <a href="http://www.echox.de/blog/archives/74-ZSH-Prompt.html">http://www.echox.de/blog/archives/74-ZSH-Prompt.html</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tsdh.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tsdh.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tsdh.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tsdh.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tsdh.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tsdh.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tsdh.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tsdh.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tsdh.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tsdh.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tsdh.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tsdh.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=35&subd=tsdh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tsdh.wordpress.com/2007/12/06/my-funky-zsh-prompt/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9a009f0bee1ee8c91fc63463c4ea5463?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">tsdh</media:title>
		</media:content>

		<media:content url="http://www.tsdh.de/images/zsh-prompt.png" medium="image">
			<media:title type="html">ZSH prompt</media:title>
		</media:content>
	</item>
		<item>
		<title>View documents (PDF/PostScript/DVI) inside Emacs</title>
		<link>http://tsdh.wordpress.com/2007/08/22/view-documents-pdfpostscriptdvi-inside-emacs/</link>
		<comments>http://tsdh.wordpress.com/2007/08/22/view-documents-pdfpostscriptdvi-inside-emacs/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 18:59:25 +0000</pubDate>
		<dc:creator>Tassilo Horn</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[dvi]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[postscript]]></category>
		<category><![CDATA[ps]]></category>

		<guid isPermaLink="false">http://tsdh.wordpress.com/2007/08/22/view-documents-pdfpostscriptdvi-inside-emacs/</guid>
		<description><![CDATA[Today I wrote an extension for emacs that lets you view pdf, ps or dvi documents in emacs.  It&#8217;s named doc-view.el and I posted it to the emacs-sources mailing list (here it is).  But I recommend that you get the latest version by cloning my Git repository.
A description of doc-view.el and how to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=34&subd=tsdh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I wrote an extension for emacs that lets you view pdf, ps or dvi documents in emacs.  It&#8217;s named <tt>doc-view.el</tt> and I posted it to the emacs-sources mailing list (<a href="http://www.mail-archive.com/gnu-emacs-sources@gnu.org/msg01114.html">here it is</a>).  But I recommend that you get the latest version by cloning my Git repository.</p>
<p>A description of <tt>doc-view.el</tt> and how to get it can be found on my <a href="http://www.tsdh.de/cgi-bin/wiki.pl/doc-view.el">homepage</a>.</p>
<p>UPDATE: doc-view is official part of Emacs and the default viewer for DVI and PDF files.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tsdh.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tsdh.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tsdh.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tsdh.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tsdh.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tsdh.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tsdh.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tsdh.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tsdh.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tsdh.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tsdh.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tsdh.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=34&subd=tsdh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tsdh.wordpress.com/2007/08/22/view-documents-pdfpostscriptdvi-inside-emacs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9a009f0bee1ee8c91fc63463c4ea5463?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">tsdh</media:title>
		</media:content>
	</item>
		<item>
		<title>Directory local variables</title>
		<link>http://tsdh.wordpress.com/2007/08/14/directory-local-variables/</link>
		<comments>http://tsdh.wordpress.com/2007/08/14/directory-local-variables/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 11:05:09 +0000</pubDate>
		<dc:creator>Tassilo Horn</dc:creator>
				<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://tsdh.wordpress.com/2007/08/14/directory-local-variables/</guid>
		<description><![CDATA[You probably know file local variables. If not read (info "(emacs)File Variables"). They&#8217;re quite handy if you work on projects that use different coding conventions, e.g. some indent with tabs and others don&#8217;t. The problem with this approach is that it requires you to modify the files.
To escape this restriction I came up with this:
(defvar [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=33&subd=tsdh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>You probably know file local variables. If not read <tt>(info "(emacs)File Variables")</tt>. They&#8217;re quite handy if you work on projects that use different coding conventions, e.g. some indent with tabs and others don&#8217;t. The problem with this approach is that it requires you to modify the files.</p>
<p>To escape this restriction I came up with this:</p>
<pre><code>(defvar th-dir-local-variables-alist
  '(("~/repos/gnus/" . ((indent-tabs-mode . t)
                        (tab-width . 8))))
  "An alist with (PATH . LIST) pairs.  PATH is a path and LIST is
a list of variables to set locally for files below that path.  It
has elements of the form (VAR . VAL) where VAR is a symbol and
VAL is its value.")

(defun th-set-dir-local-variables ()
  "Locally set the variables defined in
`th-dir-local-variables-alist' for the current buffer."
  (interactive)
  (let ((file (buffer-file-name (current-buffer))))
    (when file
      (dolist (pair th-dir-local-variables-alist)
        (when (string-match (concat "^" (regexp-quote (expand-file-name (car pair))))
                            file)
          (dolist (var (cdr pair))
            (if (local-variable-if-set-p (car var))
                (set (car var) (cdr var))
              (set (make-local-variable (car var)) (cdr var)))))))))

(add-hook 'find-file-hook
          'th-set-dir-local-variables)</code></pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tsdh.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tsdh.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tsdh.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tsdh.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tsdh.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tsdh.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tsdh.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tsdh.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tsdh.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tsdh.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tsdh.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tsdh.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=33&subd=tsdh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tsdh.wordpress.com/2007/08/14/directory-local-variables/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9a009f0bee1ee8c91fc63463c4ea5463?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">tsdh</media:title>
		</media:content>
	</item>
		<item>
		<title>Executing commands with abbreviations, reloaded</title>
		<link>http://tsdh.wordpress.com/2007/07/26/executing-commands-with-abbreviations-reloaded/</link>
		<comments>http://tsdh.wordpress.com/2007/07/26/executing-commands-with-abbreviations-reloaded/#comments</comments>
		<pubDate>Thu, 26 Jul 2007 17:29:54 +0000</pubDate>
		<dc:creator>Tassilo Horn</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[completion]]></category>

		<guid isPermaLink="false">http://tsdh.wordpress.com/2007/07/26/executing-commands-with-abbreviations-reloaded/</guid>
		<description><![CDATA[Yesterday I posted a command that executes emacs commands by giving an abbreviation. Today I&#8217;ve built a complete global minor mode around it. Here&#8217;s the file&#8217;s description:
This file  includes the command  `exec-abbrev-cmd&#8217; which lets you  execute a
command by  giving it in an  abbreviated form, where  the abbreviation takes
the first [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=32&subd=tsdh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://tsdh.wordpress.com/2007/07/25/execute-commands-by-giving-its-abbreviation/">Yesterday</a> I posted a command that executes emacs commands by giving an abbreviation. Today I&#8217;ve built a complete global minor mode around it. Here&#8217;s the file&#8217;s description:</p>
<p><em>This file  includes the command  `exec-abbrev-cmd&#8217; which lets you  execute a<br />
command by  giving it in an  abbreviated form, where  the abbreviation takes<br />
the first character of each word in the command name.  For example &#8220;g&#8221; is an<br />
abbreviation  for   the  command  `gnus&#8217;,   &#8220;eb&#8221;  is  an   abbreviation  for<br />
`emms-browser&#8217;  and &#8220;omm&#8221;  is an  abbreviation for  `outline-minor-mode&#8217;. Of<br />
course  it  is possible,  that  an  abbreviation  matches several  commands,<br />
e.g. &#8220;g&#8221; matches  not only `gnus&#8217; but `grep&#8217;, `gdb&#8217; and  some more.  In such<br />
cases you will be queried, which command to use.</em></p>
<p><em>To have this  functionality quickly accessible you might want  to bind it to<br />
some key.  That&#8217;s what I use:</em></p>
<pre><code>(add-to-list 'load-path "~/elisp") ;; Where is exec-abbrev-cmd.el?
(require 'exec-abbrev-cmd)         ;; Load it.
(global-set-key (kbd "C-x x") 'exec-abbrev-cmd)</code></pre>
<p><em>Now you&#8217;ll say,  &#8220;Wow, what a nice feature!&#8221;, but  it&#8217;s even getting better.<br />
Let&#8217;s say  you often invoke  `customize-face&#8217; with `C-x  x cf RET&#8217;  and then<br />
choosing from the completion  list between `copy-file&#8217; and `customize-face&#8217;.<br />
Always `copy-file&#8217; is selected  first, because it&#8217;s lexicographically before<br />
`customize-face&#8217;.     As    a    solution    to   this    problem    there&#8217;s<br />
`exec-abbrev-cmd-mode&#8217;, a global minor  mode that does bookkeeping how often<br />
you invoke  a command with `exec-abbrev-cmd&#8217;,  so that the  list of commands<br />
you have  to choose from is  sorted by the frequency  of command invokation.<br />
After a while in most cases `C-x x &lt;abbrev&gt; RET RET&#8217; will do what you want.</em></p>
<p><em>If you want to enable this feature put this in your ~/.emacs:</em></p>
<pre><code>(exec-abbrev-cmd-mode 1)</code></pre>
<p><em>Have fun!</em></p>
<p>You can get <a href="http://www.tsdh.de/repos/darcs/elisp/exec-abbrev-cmd.el"><tt>exec-abbrev-cmd.el</tt></a> from my <a href="http://www.tsdh.de/repos/darcs/elisp/">elisp darcs repository</a>.</p>
<p><strong>UPDATE</strong>: I moved all my projects to Git repositories.  Have a look at <a href="http://www.tsdh.de/cgi-bin/wiki.pl/exec-abbrev-cmd.el">my homepage</a> for more infos on <tt>exec-abbrev-cmd.el</tt>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tsdh.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tsdh.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tsdh.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tsdh.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tsdh.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tsdh.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tsdh.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tsdh.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tsdh.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tsdh.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tsdh.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tsdh.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=32&subd=tsdh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tsdh.wordpress.com/2007/07/26/executing-commands-with-abbreviations-reloaded/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9a009f0bee1ee8c91fc63463c4ea5463?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">tsdh</media:title>
		</media:content>
	</item>
		<item>
		<title>Execute commands by giving its abbreviation</title>
		<link>http://tsdh.wordpress.com/2007/07/25/execute-commands-by-giving-its-abbreviation/</link>
		<comments>http://tsdh.wordpress.com/2007/07/25/execute-commands-by-giving-its-abbreviation/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 07:58:36 +0000</pubDate>
		<dc:creator>Tassilo Horn</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[completion]]></category>

		<guid isPermaLink="false">http://tsdh.wordpress.com/2007/07/25/execute-commands-by-giving-its-abbreviation/</guid>
		<description><![CDATA[Today I looked at my ~/.emacs file and I saw that I defined a lot of aliases for commands I frequently use. Most of the time the aliases are words that are built by taking each first char of a word in the command, e.g. nsn for newsticker-show-news, eb for emms-browser or omm for outline-minor-mode. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=31&subd=tsdh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today I looked at my <tt>~/.emacs</tt> file and I saw that I defined a lot of aliases for commands I frequently use. Most of the time the aliases are words that are built by taking each first char of a word in the command, e.g. <tt>nsn</tt> for <tt>newsticker-show-news</tt>, <tt>eb</tt> for <tt>emms-browser</tt> or <tt>omm</tt> for <tt>outline-minor-mode</tt>. But what should I do when I want to create an alias for <tt>ediff-buffers</tt> since <tt>eb</tt> is already used?</p>
<p>My solution was to write a function that calls a command by its abbreviation.</p>
<pre><code>(defun th-execute-abbreviated-command (prefixarg)
  "Queries for a command abbreviation like "mbm" and calculates
a list of all commands of the form "m[^-]*-b[^-]*-m[^-]*$". If
this list has only one item, this command will be called
interactively. If there a more choices, the user will be queried
which one to call.

The PREFIXARG is passed on to the invoked command."
  (interactive "P")
  (let* ((abbrev (read-from-minibuffer "Command Abbrev: "))
         (regexp (let ((char-list (append abbrev nil)) ;; string =&gt; list of chars
                       (str "^"))
                   (dolist (c char-list)
                     (setq str (concat str (list c) "[^-]*-")))
                   (concat (substring str 0 (1- (length str))) "$")))
         (commands (remove-if-not (lambda (string) (string-match regexp string))
                                  (let (c)
                                    (mapatoms (lambda (a)
                                                (if (commandp a)
                                                    (push (symbol-name a) c))))
                                    c))))
    (cond ((&gt; (length commands) 1)
           (call-interactively (intern
                                (if ido-mode
                                    (ido-completing-read "Command: " commands)
                                  (completing-read "Command: " commands)))
                               t))
          ((= (length commands) 1)
           (call-interactively (intern (car commands)) t))
          (t (message "No such command.")))))</code></pre>
<p>To make it quickly accessible I&#8217;ve bound it to <tt>C-x x</tt>.</p>
<pre><code>(global-set-key (kbd "C-x x") 'th-execute-abbreviated-command)</code></pre>
<p>UPDATE:<br />
<a href="http://www.emacswiki.org/cgi-bin/wiki/AlexSchroeder">Alex Schröder</a> pointed me to the builtin <tt>partial-completion-mode</tt> which allows nearly the same. It requires that you type the separator (- or _), too, so you need a few keystrokes more when you know the commands name. On the other hand it completes not only function names, but also files, e.g. <tt>f_b.c</tt> will expand to <tt>foo_bar.c</tt>.</p>
<p>UPDATE2:<br />
The version above uses <tt>ido-completing-read</tt> when <tt>ido-mode</tt> is enabled.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tsdh.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tsdh.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tsdh.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tsdh.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tsdh.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tsdh.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tsdh.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tsdh.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tsdh.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tsdh.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tsdh.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tsdh.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=31&subd=tsdh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tsdh.wordpress.com/2007/07/25/execute-commands-by-giving-its-abbreviation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9a009f0bee1ee8c91fc63463c4ea5463?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">tsdh</media:title>
		</media:content>
	</item>
		<item>
		<title>XMonad does things just right</title>
		<link>http://tsdh.wordpress.com/2007/06/24/xmonad-does-things-just-right/</link>
		<comments>http://tsdh.wordpress.com/2007/06/24/xmonad-does-things-just-right/#comments</comments>
		<pubDate>Sun, 24 Jun 2007 09:40:51 +0000</pubDate>
		<dc:creator>Tassilo Horn</dc:creator>
				<category><![CDATA[XMonad]]></category>

		<guid isPermaLink="false">http://tsdh.wordpress.com/2007/06/24/xmonad-does-things-just-right/</guid>
		<description><![CDATA[Two weeks ago I became aware of all the buzz about XMonad and so I tried it. With its default settings it&#8217;s pretty much like dwm, but there&#8217;s a XMonadContrib module that includes a whole bunch of additional layout algorithms which might be useful in one or the other situation.
XMonad is configured by editing a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=30&subd=tsdh&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Two weeks ago I became aware of all the buzz about <a href="http://www.xmonad.org">XMonad</a> and so I tried it. With its default settings it&#8217;s pretty much like <a href="http://dwm.suckless.org">dwm</a>, but there&#8217;s a XMonadContrib module that includes a whole bunch of additional layout algorithms which might be useful in one or the other situation.</p>
<p>XMonad is configured by editing a haskell source file named <tt>Config.hs</tt> and recompiling. It&#8217;s not like in lisp that you can edit the source and evaluate your changes without restart, but XMonad can be restarted with <tt>M-q</tt> without losing window or workspace informations.</p>
<p>The time I tried it out there was a <tt>xmonad-darcs</tt> ebuild in the gentoo-haskell overlay, but that didn&#8217;t have support for user configurations. Gentoo provides a mechanism for that, so extended the ebuild with that functionality. If you set <tt>USE=savedconfig</tt> for it, then the file <tt>/etc/portage/savedconfig/x11-wm/xmonad-darcs-0</tt> will be used as <tt>Config.hs</tt> for compilation.</p>
<p>Another addition I made was that the ebuild fetches and uses the contrib modules if you set <tt>USE=extensions</tt> for it.</p>
<p>Both enhancements are now in the <tt>x11-wm/xmonad-darcs</tt> ebuild available in the gentoo-haskell overlay. (You can add the overlay with <tt>layman -a haskell</tt> and update it with <tt>layman -S</tt>, which will update all installed overlays. After that use the normal <tt>emerge</tt> command.)</p>
<p>My <tt>Config.hs</tt> can be gotten from <a href="http://www.tsdh.de/cgi-bin/wiki.pl/Configs">my homepage, section Configs</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tsdh.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tsdh.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tsdh.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tsdh.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tsdh.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tsdh.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tsdh.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tsdh.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tsdh.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tsdh.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tsdh.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tsdh.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tsdh.wordpress.com&blog=573640&post=30&subd=tsdh&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tsdh.wordpress.com/2007/06/24/xmonad-does-things-just-right/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9a009f0bee1ee8c91fc63463c4ea5463?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">tsdh</media:title>
		</media:content>
	</item>
	</channel>
</rss>