Cleanup + comments

This commit is contained in:
Henrik Lissner 2014-08-10 03:15:16 -04:00
parent f432fea0c0
commit de72111bbe
2 changed files with 19 additions and 9 deletions

View file

@ -31,7 +31,7 @@
(mapc 'require (mapc 'require
'(core ; Just the... bear necessities... '(core ; Just the... bear necessities...
my-defuns my-defuns ; Personal functions
;; Modules to improve on emacs' heresy ;; Modules to improve on emacs' heresy
init-project ; Project navigation tools & settings init-project ; Project navigation tools & settings

View file

@ -19,28 +19,34 @@
;;;; Commands ;;;;;;;;;;;;;;;;;;;;;; ;;;; Commands ;;;;;;;;;;;;;;;;;;;;;;
;; File navigation defuns ;; File navigation defuns
(defun my/initfiles () (defun my/initfiles ()
"Do an ido-find in ~/.emacs.d"
(interactive) (interactive)
(ido-find-file-in-dir my/dir)) (ido-find-file-in-dir my/dir))
(defun my/open-scratch () (defun my/open-scratch ()
"Open a blank scratch buffer"
(interactive) (interactive)
(switch-to-buffer (get-buffer-create "*scratch*")) (switch-to-buffer (get-buffer-create "*scratch*"))
(text-mode)) (text-mode))
(defun my/expand-space () (defun my/expand-space ()
"Insert a space ahead of the cursor"
(interactive) (interactive)
(save-excursion (insert " "))) (save-excursion (insert " ")))
(defun my/expand-backspace () (defun my/expand-backspace ()
"Add a space before and ahead of the cursor"
(interactive) (interactive)
(save-excursion (delete-char 1)) (save-excursion (delete-char 1))
(delete-backward-char 1)) (delete-backward-char 1))
(defun my/enable-hard-wrap() (defun my/enable-hard-wrap()
"Enable hard line wrapping"
(interactive) (interactive)
(auto-fill-mode 1)) (auto-fill-mode 1))
(defun my/byte-recompile () (defun my/byte-recompile ()
"Byte compile init.el, ~/.emacs.d/init/* and ~/.emacs.d/elisp/*"
(interactive) (interactive)
(byte-recompile-file (expand-file-name "init.el" my/dir)) (byte-recompile-file (expand-file-name "init.el" my/dir))
(byte-recompile-directory my/init-dir 0) (byte-recompile-directory my/init-dir 0)
@ -52,11 +58,13 @@
(ido-find-file-in-dir "~/Dropbox/notes")) (ido-find-file-in-dir "~/Dropbox/notes"))
(defun my/kill-all-buffers () (defun my/kill-all-buffers ()
"Kill all buffers, even the one you're in"
(interactive) (interactive)
(mapc 'kill-buffer (buffer-list)) (mapc 'kill-buffer (buffer-list))
(message "All buffers killed")) (message "All buffers killed"))
(defun my/kill-other-buffers () (defun my/kill-other-buffers ()
"Kill all buffers but the one you're in"
(interactive) (interactive)
(mapc 'kill-buffer (cdr (buffer-list (current-buffer)))) (mapc 'kill-buffer (cdr (buffer-list (current-buffer))))
(message "All other buffers killed")) (message "All other buffers killed"))
@ -73,6 +81,8 @@
(setq ac-sources (append '(ac-source-filename ac-source-files-in-current-dir) ac-sources))) (setq ac-sources (append '(ac-source-filename ac-source-files-in-current-dir) ac-sources)))
(defun my/setup-run-code(mode interpreter) (defun my/setup-run-code(mode interpreter)
"Set up s-r to run code using a specified interpreter and print the
output in the echo area"
(interactive) (interactive)
(nmap mode (kbd "s-r") (nmap mode (kbd "s-r")
(λ (shell-command-on-region (point-min) (point-max) interpreter))) (λ (shell-command-on-region (point-min) (point-max) interpreter)))