Created
October 1, 2010 21:38
-
-
Save ramen/606906 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun move-region-up (arg) | |
(interactive "p") | |
(unless mark-active (mark-line 1)) | |
(kill-region (region-beginning) (region-end)) | |
(unwind-protect | |
(forward-line (- arg)) | |
(yank)) | |
(setq deactivate-mark nil)) | |
(defun move-region-down (arg) | |
(interactive "p") | |
(unless mark-active (mark-line 1)) | |
(kill-region (region-beginning) (region-end)) | |
(unwind-protect | |
(forward-line arg) | |
(yank)) | |
(setq deactivate-mark nil)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment