diff options
| author | Luke Hoersten <[email protected]> | 2013-06-25 11:12:54 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2013-06-25 11:12:54 -0500 |
| commit | 752a6b55b5acf3a6dc9aa2a173b6c7816b67869d (patch) | |
| tree | 86aac83c98a7f7268941b94b22abca7a14246ff6 /pastebin-region.el | |
| parent | 73b4be610f2be63e44a6fd75fc9a9891a560569f (diff) | |
Tons more cleanups after emacs24 update.
Diffstat (limited to 'pastebin-region.el')
| -rw-r--r-- | pastebin-region.el | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/pastebin-region.el b/pastebin-region.el deleted file mode 100644 index fbae423..0000000 --- a/pastebin-region.el +++ /dev/null @@ -1,43 +0,0 @@ -;; ~/.emacs.d/hoersten-pastebin-region.el -;; Luke Hoersten <[email protected]> - -;; custom keys -(global-set-key (kbd "C-c w") 'pastebin-region) - -;; Based on http://www.emacswiki.org/cgi-bin/wiki/download/pastebin.el -(defvar pastebin-type-assoc - '((emacs-lisp-mode . "common-lisp") - (c-mode . "c") - (python-mode . "python") - (nxml-mode . "xml") - (c++-mode . "cpp"))) - -(defun pastebin-region (start end) - "Send selected text to dpaste pastebin." - (interactive "r") - (let* - ((pastebin-url "http://inf/paste/") - (url-request-method "POST") - (url-request-extra-headers '(("Content-Type" . "application/x-www-form-urlencoded"))) - (url-request-data - (format - "title=%s&content=%s&lexer=%s&author=%s" - (url-hexify-string (buffer-file-name)) ; title - (url-hexify-string (buffer-substring-no-properties start end)) ; content - (url-hexify-string (or (assoc-default major-mode pastebin-type-assoc) "text")) ; lexer - (url-hexify-string (user-full-name))))) ; author - (url-retrieve - pastebin-url - (lambda (arg) - (cond - ((equal :error (car arg)) - (signal (cdr arg))) - ((equal :redirect (car arg)) - (let ((redirected (cadr arg))) - (message redirected) - (with-temp-buffer - (insert redirected) - (clipboard-kill-ring-save (point-min) (point-max)))))))))) - -(message "Loading pastebin-region...done") -(provide 'pastebin-region) |
