Permalink
Browse files

On begin-end-, if active region, surround it

  • Loading branch information...
smiller committed Jan 12, 2015
1 parent f7d9aa3 commit 1c18565c48237d44f60e9ed68a832a8056085ace
Showing with 38 additions and 2 deletions.
  1. +38 −2 mods-org.el
View
@@ -20,21 +20,57 @@
))
(defun begin-end-quote ()
(interactive)
(if (use-region-p)
(begin-end-quote-for-region)
(begin-end-quote-new)
)
)
(defun begin-end-quote-for-region ()
(interactive)
(insert "#+end_quote")
(newline)
(goto-char (region-beginning))
(insert "#+begin_quote")
(newline)
)
(defun begin-end-quote-new ()
(interactive)
(insert "#+begin_quote")
(newline)
(newline)
(insert "#+end_quote")
(newline)
(previous-line)
(previous-line))
(previous-line)
)
(defun begin-end-verse ()
(interactive)
(if (use-region-p)
(begin-end-verse-for-region)
(begin-end-verse-new)
)
)
(defun begin-end-verse-for-region ()
(interactive)
(insert "#+end_verse")
(newline)
(goto-char (region-beginning))
(insert "#+begin_verse")
(newline)
)
(defun begin-end-verse-new ()
(interactive)
(insert "#+begin_verse")
(newline)
(newline)
(insert "#+end_verse")
(newline)
(previous-line)
(previous-line))
(previous-line)
)

0 comments on commit 1c18565

Please sign in to comment.