Skip to content

Instantly share code, notes, and snippets.

@evmar
Created November 24, 2010 00:37
Show Gist options
  • Save evmar/712868 to your computer and use it in GitHub Desktop.
Save evmar/712868 to your computer and use it in GitHub Desktop.
(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