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

Unified Diff: tools/emacs/flymake-chromium.el

Issue 8872013: Fix flymake to work with my Emacs, and hopefully not break others. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check for nil. Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/emacs/flymake-chromium.el
diff --git a/tools/emacs/flymake-chromium.el b/tools/emacs/flymake-chromium.el
index 070fada13a9e22d38cdad4e405470e79c1b15fe6..a4d6d7ba1c1219d41d23bdf75c742f6b4f3bc61e 100644
--- a/tools/emacs/flymake-chromium.el
+++ b/tools/emacs/flymake-chromium.el
@@ -18,9 +18,18 @@
(defcustom cr-flymake-ninja-executable "ninja"
"Ninja executable location; either in $PATH or explicitly given.")
+(defun cr-flymake-absbufferpath ()
+ "Return the absolute path to the current buffer. On some
+ Emacsen, buffer-file-truename is not absolute but rather uses a
Ami GONE FROM CHROMIUM 2011/12/08 16:17:01 I believe this behavior is in fact the case for al
Ami GONE FROM CHROMIUM 2011/12/08 19:27:49 Remove the second sentence of the docstring.
Jói 2011/12/08 20:46:16 Done.
+ path relative to the user's home dir (with ~)."
+ (when buffer-file-truename
+ (expand-file-name buffer-file-truename)))
+
(defun cr-flymake-chromium-src ()
"Return chromium's src/ directory, or nil on failure."
- (locate-dominating-file buffer-file-truename cr-flymake-ninja-build-file))
+ (let ((srcdir (locate-dominating-file
+ (cr-flymake-absbufferpath) cr-flymake-ninja-build-file)))
+ (when srcdir (expand-file-name srcdir))))
Ami GONE FROM CHROMIUM 2011/12/08 19:27:49 You don't need this when (and thus the above let)
Jói 2011/12/08 20:46:16 locate-dominating-file is fine with a nil and then
Ami GONE FROM CHROMIUM 2011/12/08 20:49:16 I was mis-reading the code before (thinking you're
(defun cr-flymake-string-prefix-p (prefix str)
"Return non-nil if PREFIX is a prefix of STR (23.2 has string-prefix-p but
@@ -33,8 +42,8 @@
we're under chromium/src/."
(when (and (cr-flymake-chromium-src)
(cr-flymake-string-prefix-p
- (cr-flymake-chromium-src) buffer-file-truename))
- (substring buffer-file-truename (length (cr-flymake-chromium-src)))))
+ (cr-flymake-chromium-src) (cr-flymake-absbufferpath)))
+ (substring (cr-flymake-absbufferpath) (length (cr-flymake-chromium-src)))))
Ami GONE FROM CHROMIUM 2011/12/08 16:17:01 I don't understand the need for these abspath chan
(defun cr-flymake-from-build-to-src-root ()
"Return a path fragment for getting from the build.ninja file to src/."
@@ -68,7 +77,7 @@
"Kick off a syntax check after file save, if flymake-mode is on."
(when flymake-mode (flymake-start-syntax-check)))
-(defadvice next-error (around cr-flymake-next-error activate)
Ami GONE FROM CHROMIUM 2011/12/08 16:17:01 This change is wrong - that particular arg to defa
+(defadvice next-error (around flymake-next-error activate)
"If flymake has something to say, let it say it; otherwise
revert to normal next-error behavior."
(if (not flymake-err-info)
« 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