diff options
| author | Luke Hoersten <[email protected]> | 2009-12-13 11:45:37 -0600 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2009-12-13 11:45:37 -0600 |
| commit | fcc4fef5ae8adec386f8e0d94e5f332cc6f8c3c8 (patch) | |
| tree | dd206d519e4d632bce661f8f16eba16137c5b514 /hoersten-pastebin-region.el | |
| parent | a000043b62d280268b0369e3f2be8a4badafc4c7 (diff) | |
Updated nav and yasnipped modes as well as cleaned up the pastebin script.
Diffstat (limited to 'hoersten-pastebin-region.el')
| -rw-r--r-- | hoersten-pastebin-region.el | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/hoersten-pastebin-region.el b/hoersten-pastebin-region.el index ab7be13..ccaa0ef 100644 --- a/hoersten-pastebin-region.el +++ b/hoersten-pastebin-region.el @@ -15,24 +15,28 @@ (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)))))))))) + (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)))))))))) (provide 'hoersten-pastebin-region) |
