author | Luke Hoersten <Luke@Hoersten.org> |
Wed, 15 Jun 2011 22:05:06 -0500 | |
changeset 43 | cfdd7b253085 |
parent 35 | 4a9c440b6764 |
permissions | -rw-r--r-- |
29
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
1 |
;; ~/.emacs.d/hoersten-align-with-spaces.el |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
2 |
;; Luke Hoersten <[email protected]> |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
3 |
|
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
4 |
(global-set-key (kbd "C-c a") 'align-with-spaces) |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
5 |
(defun align-with-spaces (beg end pattern) |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
6 |
"Align selected using only spaces for whitespace." |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
7 |
(interactive "r\nsAlign by: ") |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
8 |
(let ((indent-tabs-mode nil)) |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
9 |
(align-string beg end pattern 1) |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
10 |
(align-entire beg end) |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
11 |
(untabify beg end) |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
12 |
(indent-region beg end) |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
13 |
(whitespace-cleanup-region beg end))) |
b52bb6669eed
Added align-with-spaces require.
Luke Hoersten <Luke@Hoersten.org>
parents:
diff
changeset
|
14 |
|
35
4a9c440b6764
Moved 3rd party libs to separate dir and added optional scion haskell support.
Luke Hoersten <Luke@Hoersten.org>
parents:
29
diff
changeset
|
15 |
(message "Loading align-with-spaces...done") |
4a9c440b6764
Moved 3rd party libs to separate dir and added optional scion haskell support.
Luke Hoersten <Luke@Hoersten.org>
parents:
29
diff
changeset
|
16 |
(provide 'align-with-spaces) |