src.nth.io/

summaryrefslogtreecommitdiff
path: root/hoersten-align-with-spaces.el
diff options
context:
space:
mode:
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)