Skip to content

Instantly share code, notes, and snippets.

@sshine
Created March 16, 2013 15:16
Show Gist options
  • Save sshine/5176830 to your computer and use it in GitHub Desktop.
Save sshine/5176830 to your computer and use it in GitHub Desktop.
;; I don't use these macros very often, but I keep them here because they
;; might be useful if I should want to make similar macros in the future.
(defun absalon-html-escape-code ()
"Wrap marked region with HTML pre codes."
(interactive)
(save-excursion (goto-char (region-beginning))
(insert "<pre style=\"background: #eee; padding: 1em\">\n"))
(save-excursion (goto-char (region-end))
(insert "</pre>")))
(defun absalon-html-error-comment ()
"Insert a red comment in HTML span codes."
(interactive)
(save-excursion (insert "<span style=\"color: red\">&lt;--- </span>"))
(forward-char 33))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment