changeset 207:c965d5dbd868

emacs localfuncs: add list rotation and string-joining functions I sometimes use
author Augie Fackler <durin42@gmail.com>
date Tue, 11 May 2010 15:32:19 -0500
parents 5599a864b888
children 50244cf921fb
files .elisp/settings/50.localfuncs.el
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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  "