From: Steven Baltakatei Sandoval Date: Tue, 17 Nov 2020 02:17:42 +0000 (+0000) Subject: feat(unitproc):Add elisp function def for reversing text. X-Git-Tag: 0.3.0~6 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/2d5bc059f7234f883ced2e231185e665d954c5ec?hp=-c feat(unitproc):Add elisp function def for reversing text. See: https://emacs.stackexchange.com/a/38159 new file: unitproc/elisp/my-reverse-region.el --- 2d5bc059f7234f883ced2e231185e665d954c5ec 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))))