summary refs log tree commit diff stats
path: root/emacs/elisp/shuffle-lines.el
diff options
context:
space:
mode:
authorAlan Pearce2013-04-28 20:54:18 +0100
committerAlan Pearce2013-04-28 20:54:18 +0100
commite7657d6ba54ad5714657cff9be86ec416d342a4c (patch)
tree50a2fada14e8d5f76ef890c4b860fbdd4faf812f /emacs/elisp/shuffle-lines.el
parent6bec14c2d18c915a3510aba36a37e78a8b83170f (diff)
downloadnixfiles-e7657d6ba54ad5714657cff9be86ec416d342a4c.tar.lz
nixfiles-e7657d6ba54ad5714657cff9be86ec416d342a4c.tar.zst
nixfiles-e7657d6ba54ad5714657cff9be86ec416d342a4c.zip
Migrate repository from mercurial without history
Diffstat (limited to 'emacs/elisp/shuffle-lines.el')
-rw-r--r--emacs/elisp/shuffle-lines.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/emacs/elisp/shuffle-lines.el b/emacs/elisp/shuffle-lines.el
new file mode 100644
index 00000000..be0a98f9
--- /dev/null
+++ b/emacs/elisp/shuffle-lines.el
@@ -0,0 +1,20 @@
+;;;###autoload
+(defun move-line-down ()
+    (interactive)
+    (let ((col (current-column)))
+        (save-excursion
+            (forward-line)
+            (transpose-lines 1))
+        (forward-line)
+        (move-to-column col)))
+
+;;;###autoload
+(defun move-line-up ()
+    (interactive)
+    (let ((col (current-column)))
+        (save-excursion
+            (forward-line)
+            (transpose-lines -1))
+        (move-to-column col)))
+
+(provide 'shuffle-lines)