Created
November 24, 2010 00:37
-
-
Save evmar/712868 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun trybot (url) | |
"doc" | |
(interactive "sURL to stdout: ") | |
; Extract the body out of the URL. | |
; XXX how to clip HTTP headers? | |
(with-current-buffer (url-retrieve-synchronously url) | |
;(re-search-forward "^$") | |
(kill-region (point-min) (point-max))) | |
; Put the body into a new trybot buffer. | |
(when (get-buffer "*trybot*") | |
(kill-buffer "*trybot*")) | |
(switch-to-buffer (get-buffer-create "*trybot*")) | |
(yank) | |
(delete-trailing-whitespace) ; Delete Windows \r. | |
; Fixup paths. | |
(cd "/work/chrome/src") | |
(goto-char (point-min)) | |
(while (re-search-forward "^.:\\\\.*\\\\src\\\\" nil t) | |
(replace-match "") | |
; XXX eats backslashes after the filename | |
(subst-char-in-region (point) (line-end-position) ?\\ ?/) | |
) | |
(goto-char (point-min)) | |
(compilation-mode)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment