| OLD | NEW |
| 1 ; To use this, | 1 ; To use this, |
| 2 ; 1) Add to init.el: | 2 ; 1) Add to init.el: |
| 3 ; (setq-default chrome-root "/path/to/chrome/src/") | 3 ; (setq-default chrome-root "/path/to/chrome/src/") |
| 4 ; (add-to-list 'load-path (concat chrome-root "tools/emacs")) | 4 ; (add-to-list 'load-path (concat chrome-root "tools/emacs")) |
| 5 ; (require 'trybot) | 5 ; (require 'trybot) |
| 6 ; 2) Run on trybot output: | 6 ; 2) Run on trybot output: |
| 7 ; M-x trybot | 7 ; M-x trybot |
| 8 ; | 8 ; |
| 9 ; To hack on this, | 9 ; To hack on this, |
| 10 ; M-x eval-buffer | 10 ; M-x eval-buffer |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 (defun trybot (url) | 142 (defun trybot (url) |
| 143 "Fetch a trybot URL and fix up the output into a compilation-mode buffer." | 143 "Fetch a trybot URL and fix up the output into a compilation-mode buffer." |
| 144 (interactive "sURL to trybot stdout (leave empty to use clipboard): ") | 144 (interactive "sURL to trybot stdout (leave empty to use clipboard): ") |
| 145 | 145 |
| 146 ;; Yank URL from clipboard if necessary. | 146 ;; Yank URL from clipboard if necessary. |
| 147 (when (= (length url) 0) | 147 (when (= (length url) 0) |
| 148 (with-temp-buffer | 148 (with-temp-buffer |
| 149 (clipboard-yank) | 149 (clipboard-yank) |
| 150 (setq url (buffer-string)))) | 150 (setq url (buffer-string)))) |
| 151 | 151 |
| 152 ;; TODO: fixup URL to append /text if necessary. | 152 ;; Append /text to the URL to get plain text output in the common |
| 153 ;; case of getting a URL to the HTML build log. |
| 154 (when (equal "stdio" (car (last (split-string url "/")))) |
| 155 (setq url (concat url "/text"))) |
| 153 | 156 |
| 154 (let ((type-hint (cond ((string-match "/win/" url) 'win) | 157 (let ((type-hint (cond ((string-match "/win/" url) 'win) |
| 155 ((string-match "/mac/" url) 'mac) | 158 ((string-match "/mac/" url) 'mac) |
| 156 ; Match /linux, /linux_view, etc. | 159 ; Match /linux, /linux_view, etc. |
| 157 ((string-match "/linux" url) 'linux) | 160 ((string-match "/linux" url) 'linux) |
| 158 (t 'unknown)))) | 161 (t 'unknown)))) |
| 159 (trybot-fetch type-hint url))) | 162 (trybot-fetch type-hint url))) |
| 160 | 163 |
| 161 (provide 'trybot) | 164 (provide 'trybot) |
| OLD | NEW |