Support flymake syntax checking

Mike Hearn mike at theoretic.com
Sat Oct 18 11:12:10 CDT 2003


I've had this patch sitting in my tree for a while now, and it works
well. It allows emacs users to install flymake-mode (flymake.sf.net),
which silently checks your syntax in the background. Lines with errors
or warnings in are highlighted in pastel shades :)

You need the following patch to flymake-mode (should be in the next
release) to make it work on Linux:

--- flymake.el~	2003-09-23 23:48:48.000000000 +0100
+++ flymake.el	2003-09-24 17:16:22.000000000 +0100
@ -381,7 +381,7 @@
 			   (to          (flymake-fix-path-name to-dir))
 			   (prefix      (flymake-get-common-prefix from to))
 			   (from-suffix (substring from (length prefix)))
-			   (up-count    (length (split-string from-suffix "[/]")))
+			   (up-count    (- (length (split-string from-suffix "[/]")) 1))
 			   (to-suffix   (substring to   (length prefix)))
 			   (idx         0)
 			   (rel         nil))
@@ -404,7 +404,10 @@
 			   (setq rel (concat rel to-suffix))
 			)
 
-		    rel
+		    (if (equal rel nil)
+			"./"
+		    ;; else
+		        rel)
 		)
 	)
 )


And here is the actual patch against wine to support it:

Index: Make.rules.in
===================================================================
RCS file: /home/wine/wine/Make.rules.in,v
retrieving revision 1.163
diff -u -r1.163 Make.rules.in
--- Make.rules.in       11 Oct 2003 01:05:18 -0000      1.163
+++ Make.rules.in       18 Oct 2003 15:59:09 -0000
@@ -260,6 +260,13 @@
  
 .PHONY: check test crosstest $(SUBDIRS:%=%/__test__) $(SUBDIRS:%=%/__crosstest__)
  
+# Rules for syntax checking
+
+check-syntax:
+       $(MAKE) syntax-target CFLAGS="-fsyntax-only"
+
+syntax-target: $(SOURCES:.c=.o)
+
 # Misc. rules
  
 $(MC_SRCS:.mc=.mc.rc): $(WMC)


Trivial huh? I know it's kind of emacs specific, but we already support
tags, so could this go in?

thanks -mike




More information about the wine-patches mailing list