From e14da00deaeb38dc47597d71550d4a0907ed71d9 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 25 Jun 2016 16:38:08 -0700 Subject: [PATCH] Function to replace escape sequences --- dotfiles/emacs.d/README.org | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 129a05b9..2a805fbc 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -834,7 +834,19 @@ For composing functions with an apply so that they can be used with the ~:around (compilation-start command nil (lambda (&rest args) (format "*compilation %s*" command)))) - +#+END_SRC +** Replace Escape Sequences +#+BEGIN_SRC emacs-lisp + (defun imalison:replace-escape-sequences () + (interactive) + (shut-up + (let* ((delimited (and transient-mark-mode mark-active)) + (beg (when delimited (region-beginning))) + (end (when delimited (region-end)))) + (save-excursion + (perform-replace "\\t" " " nil nil delimited nil nil beg end nil)) + (save-excursion + (perform-replace "\\n" "\n" nil nil delimited nil nil beg end nil))))) #+END_SRC ** Other #+BEGIN_SRC emacs-lisp