# HG changeset patch
# User Augie Fackler <durin42@gmail.com>
# Date 1273609939 18000
# Node ID c965d5dbd8685164de164aee6d1edd1555f2198d
# Parent  5599a864b888da04b98a23a17041e294836dc452
emacs localfuncs: add list rotation and string-joining functions I sometimes use

diff --git a/.elisp/settings/50.localfuncs.el b/.elisp/settings/50.localfuncs.el
--- a/.elisp/settings/50.localfuncs.el
+++ b/.elisp/settings/50.localfuncs.el
@@ -31,6 +31,18 @@ spends an eternity in a regex if you mak
 (global-set-key [(control c)(t)(=)] 'af-generic-diff-repo)
 (global-set-key [(control c)(d)] 'af-generic-diff-repo)
 
+(defun af-rotate-list (l)
+  "Move the head of l to the end of the list."
+  (append (cdr l) (list (car l))))
+
+(defun af-spacejoin (l)
+  "Given list of strings l, join them with spaces and return.
+
+Returns the empty string if l is nil."
+  (if l
+      (reduce '(lambda (x &optional y) (concat x " " (if y y))) l)
+    ""))
+
 (defun pyflakes-this-buffer ()
   (interactive)
   (compilation-start (concat "cd  "