From 64d682946882b9ec44857efc48354953c486441e Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 12 Nov 2011 11:51:50 +0000 Subject: [PATCH] cleaned up helpers.el a bit --- helpers.el | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/helpers.el b/helpers.el index 0d37592..831f226 100644 --- a/helpers.el +++ b/helpers.el @@ -1,4 +1,7 @@ +;; ;; Execute Ruby Code +;; + (defun is-rails-project () (when (textmate-project-root) (file-exists-p (expand-file-name "config/environment.rb" (textmate-project-root))))) @@ -13,7 +16,11 @@ (pop-to-buffer (ruby-compilation-do filename command))) (ruby-compilation-this-buffer))) + +;; ;; Auto-indent on Paste +;; + (dolist (command '(yank yank-pop)) (eval `(defadvice ,command (after indent-region activate) (and (not current-prefix-arg) @@ -28,7 +35,10 @@ (indent-region (region-beginning) (region-end) nil)))))) +;; ;; Duplicate Line +;; + (defun duplicate-line() (interactive) (move-beginning-of-line 1) @@ -37,19 +47,31 @@ (newline) (yank)) + +;; ;; Yank Pop Forwards +;; + (defun yank-pop-forwards (arg) (interactive "p") (yank-pop (- arg))) + +;; ;; Window Switching +;; + (defun other-window-reverse () "Switch to the previous window" (interactive) (other-window -1)) -;; Window Swapping (from https://gist.github.com/287633) +;; +;; Window Swapping +;; - from https://gist.github.com/287633 +;; + (defun swap-with (dir) (interactive) (let ((other-window (windmove-find-other-window dir))) @@ -64,7 +86,10 @@ (set-window-start this-window other-start) (set-window-start other-window this-start))))) +;; ;; Transparency +;; + (defun transparency-set-initial-value () "Set initial value of alpha parameter for the current frame" (interactive) @@ -97,7 +122,11 @@ (message "This is a minimum value of transparency!"))) -;; Escreen Helper (from http://blog.nguyenvq.com/2011/03/07/escreen-instead-of-elscreen-for-screen-like-features-in-emacs/) +;; +;; Escreen Helper +;; - from http://blog.nguyenvq.com/2011/03/07/escreen-instead-of-elscreen-for-screen-like-features-in-emacs/ +;; + (defun escreen-get-active-screen-numbers-with-emphasis () "what the name says" (interactive)