diff options
| author | Luke Hoersten <[email protected]> | 2009-01-09 10:39:57 -0600 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2009-01-09 10:39:57 -0600 |
| commit | 179e7c6c2956c5802f089e965606eadd34cece2c (patch) | |
| tree | 5266961078eac4c96e82c294e8566ae91da2f3b9 /hoersten-pastebin-region.el | |
| parent | 66f6f22935de450a3b0dd0a522d19e2304d2c6b5 (diff) | |
Minor updates.
Diffstat (limited to 'hoersten-pastebin-region.el')
| -rw-r--r-- | hoersten-pastebin-region.el | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/hoersten-pastebin-region.el b/hoersten-pastebin-region.el index b03a042..2430329 100644 --- a/hoersten-pastebin-region.el +++ b/hoersten-pastebin-region.el @@ -6,30 +6,30 @@ ;; 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"))) + (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://build-ch-03/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)))))))))) + (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)))))))))) |
