src.nth.io/

summaryrefslogtreecommitdiff
path: root/align-with-spaces.el
blob: cf0ad39addc824fbce04680908388d3d6dfa97f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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 "Loading align-with-spaces...done")
(provide 'align-with-spaces)