I use to wrap a selection region with a symbol. For example: wr-love-equation

1
2
3
4
5
(defun wr-love-equation (start end)
  (interactive "r")
  (save-excursion
    (goto-char end) (insert "$")
    (goto-char start) (insert "$")))

I use it a lot, but as you can see, it is not very flexible.

See, you select a region: Goggins. Then, you call M-x hello-world-skeleton:

1
2
3
4
(define-skeleton hello-world-skeleton
  "Define a motherfucker"
  nil
  "The world hardest motherfucker: " _ "!")

You will be able to see:

1
The world hardest motherfucker: Goggins!

You can prepare a ChatGPT request to rewrite a paragraph:

1
2
3
4
(define-skeleton wr-skeleton-ask-chatgpt-rewrite-paragraph
  ""
  nil
  "Rewrite following paragraph: \"" _ "\"")

You can insert a quick interactive testing function:

1
2
3
4
5
6
(define-skeleton wr-skeleton-elisp-interactive
  "Insert a defun template."
  "Name: "
  "(defun test/" str " ()" \n
  > "(interactive)\n"
  > "(" @ _ "))" \n)

Happy re-structure!