Permalink
Browse files

On begin-end- for region, remove old formatting

s/> //, s/  <br\/>//
  • Loading branch information...
smiller committed Jan 12, 2015
1 parent 1c18565 commit 853147cf787d7bb52faa7b6409f7e72b117944c9
Showing with 9 additions and 0 deletions.
  1. +9 −0 mods-org.el
View
@@ -29,6 +29,7 @@
(defun begin-end-quote-for-region ()
(interactive)
(remove-old-formatting)
(insert "#+end_quote")
(newline)
(goto-char (region-beginning))
@@ -57,6 +58,7 @@
(defun begin-end-verse-for-region ()
(interactive)
(remove-old-formatting)
(insert "#+end_verse")
(newline)
(goto-char (region-beginning))
@@ -74,3 +76,10 @@
(previous-line)
(previous-line)
)
(defun remove-old-formatting ()
(setq in (filter-buffer-substring (region-beginning) (region-end) t))
(setq out (replace-regexp-in-string "^> " "" in))
(setq out2 (replace-regexp-in-string " <br/>$" "" out))
(insert out2)
)

0 comments on commit 853147c

Please sign in to comment.