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

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

Issue 6355015: emacs: also handle paths like "..\chrome/foo/bar" seen in build output (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 10 months 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 | tools/emacs/trybot-windows.txt » ('j') | 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 27 matching lines...) Expand all
38 (if corrected-path 38 (if corrected-path
39 (file-relative-name (directory-file-name corrected-path) 39 (file-relative-name (directory-file-name corrected-path)
40 (get-chrome-root)) 40 (get-chrome-root))
41 nil)))) 41 nil))))
42 42
43 (defun trybot-fixup-win () 43 (defun trybot-fixup-win ()
44 "Fix up Windows-specific output." 44 "Fix up Windows-specific output."
45 45
46 ; Fix Windows paths ("d:\...\src\"). 46 ; Fix Windows paths ("d:\...\src\").
47 (save-excursion 47 (save-excursion
48 (while (re-search-forward "\\(^.:\\\\.*\\\\src\\\\\\)\\(.*?\\)[(:]" nil t) 48 ; This regexp is subtle and rather hard to read. :~(
49 ; Use regexp-builder when making changes to it.
50 (while (re-search-forward
51 (concat
52 ; First part: path leader, either of the form
53 ; e:\...src\ or ..\
54 "\\(^.:\\\\.*\\\\src\\\\\\|\\.\\.\\\\\\)"
55 ; Second part: path, followed by error message marker.
56 "\\(.*?\\)[(:]") nil t)
49 (replace-match "" nil t nil 1) 57 (replace-match "" nil t nil 1)
50 ; Line now looks like: 58 ; Line now looks like:
51 ; foo\bar\baz.cc error message here 59 ; foo\bar\baz.cc error message here
52 ; We want to fixup backslashes in path into forward slashes, 60 ; We want to fixup backslashes in path into forward slashes,
53 ; without modifying the error message - by matching up to the 61 ; without modifying the error message - by matching up to the
54 ; first colon above (which will be just beyond the end of the 62 ; first colon above (which will be just beyond the end of the
55 ; filename) we can use the end of the match as a limit. 63 ; filename) we can use the end of the match as a limit.
56 (subst-char-in-region (point) (match-end 0) ?\\ ?/) 64 (subst-char-in-region (point) (match-end 0) ?\\ ?/)
57 ; See if we can correct the file name casing. 65 ; See if we can correct the file name casing.
58 (let ((filename (buffer-substring (match-beginning 2) (match-end 2)))) 66 (let ((filename (buffer-substring (match-beginning 2) (match-end 2))))
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 (setq url (concat url "/text"))) 167 (setq url (concat url "/text")))
160 168
161 (let ((type-hint (cond ((string-match "/[Ww]in" url) 'win) 169 (let ((type-hint (cond ((string-match "/[Ww]in" url) 'win)
162 ((string-match "/mac/" url) 'mac) 170 ((string-match "/mac/" url) 'mac)
163 ; Match /linux, /linux_view, etc. 171 ; Match /linux, /linux_view, etc.
164 ((string-match "/linux" url) 'linux) 172 ((string-match "/linux" url) 'linux)
165 (t 'unknown)))) 173 (t 'unknown))))
166 (trybot-fetch type-hint url))) 174 (trybot-fetch type-hint url)))
167 175
168 (provide 'trybot) 176 (provide 'trybot)
OLDNEW
« no previous file with comments | « no previous file | tools/emacs/trybot-windows.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698