summaryrefslogtreecommitdiffstats
path: root/tools/emacs/trybot.el
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-10 21:27:00 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-10 21:27:00 +0000
commit5dd3199af0bb8509d4d4d106c276c018daa9e0ac (patch)
treed1bb36bed73a455386685c2fccf0a67f8eb75352 /tools/emacs/trybot.el
parent26802698e65798c601d0291d4353463770121413 (diff)
downloadchromium_src-5dd3199af0bb8509d4d4d106c276c018daa9e0ac.zip
chromium_src-5dd3199af0bb8509d4d4d106c276c018daa9e0ac.tar.gz
chromium_src-5dd3199af0bb8509d4d4d106c276c018daa9e0ac.tar.bz2
emacs: use UTF-8 and DOS encoding when reading files
This fixes: - Linux output has UTF-8 quotes in it. - Mac/Windows have DOS-style CRLF (and reading Linux with that coding system is ok). TEST=new trybot-test-linux Review URL: http://codereview.chromium.org/5778003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/emacs/trybot.el')
-rw-r--r--tools/emacs/trybot.el20
1 files changed, 12 insertions, 8 deletions
diff --git a/tools/emacs/trybot.el b/tools/emacs/trybot.el
index 78d339a..84eccdc 100644
--- a/tools/emacs/trybot.el
+++ b/tools/emacs/trybot.el
@@ -46,9 +46,6 @@
;; Fixup paths.
(cd (get-chrome-root))
- ;; Delete Windows \r.
- (delete-trailing-whitespace)
-
;; Fix up path references.
; XXX is there something I should so so this stuff doesn't end up on the
; undo stack?
@@ -82,9 +79,10 @@
"Load the given test data filename and do the trybot parse on it."
(switch-to-buffer (get-buffer-create "*trybot-test*"))
- (let ((inhibit-read-only t))
+ (let ((inhibit-read-only t)
+ (coding-system-for-read 'utf-8-dos))
(erase-buffer)
- (insert-file-contents-literally
+ (insert-file-contents
(concat (get-chrome-root) "tools/emacs/" filename))
(trybot-fixup)))
@@ -97,6 +95,10 @@
"Load the Mac test data and do the trybot parse on it."
(interactive)
(trybot-test "trybot-mac.txt"))
+(defun trybot-test-linux ()
+ "Load the Linux test data and do the trybot parse on it."
+ (interactive)
+ (trybot-test "trybot-linux.txt"))
(defun trybot (url)
"Fetch a trybot URL and fix up the output into a compilation-mode buffer."
@@ -112,9 +114,11 @@
;; Extract the body out of the URL.
; TODO: delete HTTP headers somehow.
- (switch-to-buffer (get-buffer-create "*trybot*"))
- (buffer-swap-text (url-retrieve-synchronously url))
+ (let ((inhibit-read-only t)
+ (coding-system-for-read 'utf-8-dos))
+ (switch-to-buffer (get-buffer-create "*trybot*"))
+ (buffer-swap-text (url-retrieve-synchronously url))
- (trybot-fixup))
+ (trybot-fixup)))
(provide 'trybot)