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

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: Address review comments. 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..8adb0dbe56a781ebcddbdccea7b03167bd070de7 100644
--- a/tools/emacs/flymake-chromium.el
+++ b/tools/emacs/flymake-chromium.el
@@ -18,9 +18,17 @@
(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, or nil if the
+ current buffer has no path."
+ (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))))
(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 +41,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)))))
(defun cr-flymake-from-build-to-src-root ()
"Return a path fragment for getting from the build.ninja file to src/."
« 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