Skip to content

Instantly share code, notes, and snippets.

@flazz
Created December 24, 2008 07:22
Show Gist options
  • Save flazz/39607 to your computer and use it in GitHub Desktop.
Save flazz/39607 to your computer and use it in GitHub Desktop.
(defun gist-region-or-buffer (&optional private)
"Post either the current region, or if mark is not set, the current buffer as a new paste at gist.github.com
Copies the URL into the kill ring.
With a prefix argument, makes a private paste."
(interactive "P")
(condition-case nil
(gist-region (point) (mark) private)
(mark-inactive (gist-buffer private))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment