From 2d5bc059f7234f883ced2e231185e665d954c5ec Mon Sep 17 00:00:00 2001 From: Steven Baltakatei Sandoval Date: Tue, 17 Nov 2020 02:17:42 +0000 Subject: [PATCH] feat(unitproc):Add elisp function def for reversing text. See: https://emacs.stackexchange.com/a/38159 new file: unitproc/elisp/my-reverse-region.el --- unitproc/elisp/my-reverse-region.el | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 unitproc/elisp/my-reverse-region.el diff --git a/unitproc/elisp/my-reverse-region.el b/unitproc/elisp/my-reverse-region.el new file mode 100644 index 0000000..ebe6f20 --- /dev/null +++ b/unitproc/elisp/my-reverse-region.el @@ -0,0 +1,7 @@ +;; 2020-11-17T02:13Z; bktei> Function to reverse region of text +(defun my-reverse-region (beg end) + "Reverse characters between BEG and END." + (interactive "r") + (let ((region (buffer-substring beg end))) + (delete-region beg end) + (insert (nreverse region)))) -- 2.30.2