How do I disable flymake when I'm working on Django templates?
Flymake is great for editing python files, but is really giving me problems with django templates. For instance, the following template throws no errors, though the syntax highlighting doesn't work for the template tags:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{% block title %}Page title{% endblock %}</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
{% block content %}
<p>… Your HTML content here …</p>
{% endblock %}
</body>
</html>
However, the following template is riddled with font-lock for flymake errors:
{% extends base.html %}
{% block content %}
<h1>Welcome!</h1>
{% endblock %}
Hovering over the errors with a mouse reveals that flymake is complaing about "Text not allowed".
I've followed each solution in this related question, but none of them disable flymake for html buffers. I even tried renaming all my template files to end in .djhtml
instead of .html
, but flymake was still active after re-visiting the files. I did change the auto-mode list to apply django-html-mode
to .djhtml
files, so maybe the issue lies there.
UPDATE: I've found that switching to html-mode
doesn't have this issue, since I've implemented the previously mentioned solutions. However, if I switch to nxml-mode
or django-html-mode
(what I'd like to use), flymake starts up again and tells me it is:
Using schema /usr/local/Cellar/emacs/HEAD/share/emacs/24.0.93/etc/schema/xhtml.rnc
Emacs24 Carbon on Snow Leopard.
GNU Emacs 24.0.93.1 (i386-apple-darwin10.8.0, NS apple-appkit-1038.36) of 2012-02-21 on hook