src.nth.io/

summaryrefslogtreecommitdiff
path: root/hoersten-align-with-spaces.el
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2010-11-29 11:40:31 -0600
committerLuke Hoersten <[email protected]>2010-11-29 11:40:31 -0600
commita73af1ec9b611b5f29ed5c20b0dcf48cbeddc7ac (patch)
tree02f7c46866f3bea42e6f5184963e4bffb537f258 /hoersten-align-with-spaces.el
parenta955b8107f8484f02be4300cc5e86a6daf730efb (diff)
Added align-with-spaces require.
Diffstat (limited to 'hoersten-align-with-spaces.el')
-rw-r--r--hoersten-align-with-spaces.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/hoersten-align-with-spaces.el b/hoersten-align-with-spaces.el
new file mode 100644
index 0000000..fd4806d
--- /dev/null
+++ b/hoersten-align-with-spaces.el
@@ -0,0 +1,16 @@
+;; ~/.emacs.d/hoersten-align-with-spaces.el
+;; Luke Hoersten <[email protected]>
+
+(global-set-key (kbd "C-c a") 'align-with-spaces)
+(defun align-with-spaces (beg end pattern)
+ "Align selected using only spaces for whitespace."
+ (interactive "r\nsAlign by: ")
+ (let ((indent-tabs-mode nil))
+ (align-string beg end pattern 1)
+ (align-entire beg end)
+ (untabify beg end)
+ (indent-region beg end)
+ (whitespace-cleanup-region beg end)))
+
+(message "Loaded Hoersten align-with-spaces function")
+(provide 'hoersten-align-with-spaces)