diff options
author | Tom Willemsen | 2011-02-21 00:27:43 +0100 |
---|---|---|
committer | Tom Willemsen | 2011-02-21 00:27:43 +0100 |
commit | 62f897fdf5988840ee5538e30fbd3c7bcb715735 (patch) | |
tree | 4b389e2de2919676e4fe1c7f7716d33c94ecb7db /emacs.d/elisp/functions.el | |
parent | 294a0eef5da437bb6840acfd831e6d85b988bd60 (diff) | |
download | dotfiles-62f897fdf5988840ee5538e30fbd3c7bcb715735.tar.gz dotfiles-62f897fdf5988840ee5538e30fbd3c7bcb715735.zip |
New .emacs style
* .emacs only loops through .emacs.d and runs the *.el files there.
* files are automatically compiled before loading. But only if it
hasn't already been compiled.
* all emacs el files, save for the startup scripts, have been moved
to .emacs.d/elisp
Diffstat (limited to 'emacs.d/elisp/functions.el')
-rw-r--r-- | emacs.d/elisp/functions.el | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/emacs.d/elisp/functions.el b/emacs.d/elisp/functions.el new file mode 100644 index 0000000..6472c82 --- /dev/null +++ b/emacs.d/elisp/functions.el @@ -0,0 +1,45 @@ +(defun what-face (pos) + "Find out which face the current position uses" + (interactive "d") + (let ((face (or (get-char-property (point) 'read-face-name) + (get-char-property (point) 'face)))) + (if face + (message "Face: %s" face) + (message "No face at %d" pos)))) + +(defun my-comp-finish-function (buf str) + "Don't show compilation window if everything went ok" + (if (string-match "exited abnormally" str) + ;; there were errors + (message "compilation errors, press C-x ` to visit") + ;; no errors, make the compilation window go away in 0.5 seconds + (run-at-time 0.5 nil 'delete-windows-on bu) + (message "NO COMPILATION ERRORS!"))) + +(defun bh/hide-other () + (interactive) + (save-excursion + (org-back-to-heading) + (org-shifttab) + (org-reveal) + (org-cycle))) + +(defun bh/go-to-scratch () + (interactive) + (switch-to-buffer "*scratch*") + (delete-other-windows)) + +(defun bh/untabify () + (interactive) + (untabify (point-min) (point-max))) + +(defun bh/killframe () + (interactive) + (unless (buffer-modified-p) + (kill-buffer (current-buffer))) + (delete-frame)) + +(defun show-whitespace () + (whitespace-mode t)) + +(provide 'functions) |