Skip to content

Instantly share code, notes, and snippets.

@macsf
Created April 14, 2012 11:49
Show Gist options
  • Save macsf/2383833 to your computer and use it in GitHub Desktop.
Save macsf/2383833 to your computer and use it in GitHub Desktop.
Attach region or whole buffer to new mail.
(defun mail-current-buffer ()
(interactive)
(save-excursion
(if (region-active-p)
(kill-ring-save (region-beginning) (region-end))
(kill-ring-save (point-min) (point-max)))
(mail)
(next-line 3)
(yank)
(beginning-of-buffer)
(next-line)
(end-of-line)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment