Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Side by Side Diff: tools/emacs/trybot.el

Issue 5826002: emacs: fix HTML urls to automatically load plain text (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698