hoersten-align-with-spaces.el
changeset 35 4a9c440b6764
parent 34 8e91ec6fd0a2
child 36 d915699fbc26
equal deleted inserted replaced
34:8e91ec6fd0a2 35:4a9c440b6764
     1 ;; ~/.emacs.d/hoersten-align-with-spaces.el
       
     2 ;; Luke Hoersten <[email protected]>
       
     3 
       
     4 (global-set-key (kbd "C-c a") 'align-with-spaces)
       
     5 (defun align-with-spaces (beg end pattern)
       
     6   "Align selected using only spaces for whitespace."
       
     7   (interactive "r\nsAlign by: ")
       
     8   (let ((indent-tabs-mode nil))
       
     9     (align-string beg end pattern 1)
       
    10     (align-entire beg end)
       
    11     (untabify beg end)
       
    12     (indent-region beg end)
       
    13     (whitespace-cleanup-region beg end)))
       
    14 
       
    15 (message "Loaded Hoersten align-with-spaces function")
       
    16 (provide 'hoersten-align-with-spaces)