forked from sunfmin/emacs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
defuns.el
34 lines (29 loc) · 839 Bytes
/
defuns.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
; for loading libraries in from the vendor directory
(defun vendor (library)
(let* ((file (symbol-name library))
(normal (concat "~/.emacs.d/vendor/" file))
(suffix (concat normal ".el")))
(cond
((file-directory-p normal)
(add-to-list 'load-path normal)
(require library))
((file-directory-p suffix)
(add-to-list 'load-path suffix)
(require library))
((file-exists-p suffix)
(require library)))))
(defun tabify-buffer ()
(interactive)
(tabify (point-min) (point-max)))
(defun untabify-buffer ()
(interactive)
(untabify (point-min) (point-max)))
(defun indent-buffer ()
(interactive)
(indent-region (point-min) (point-max)))
(defun cleanup-buffer ()
(interactive)
(indent-buffer)
(untabify-buffer)
(delete-trailing-whitespace))
(provide 'defuns)