Inappropriate django indentation

Bug #685749 reported by Oleg Lomaka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nXhtml
Fix Committed
Medium
Unassigned

Bug Description

There is indent after {% load commnts %} token. The indentation looks like that:

{% extends "site.html" %}
{% block title %}{{ object.title }}{% endblock %}
{% block content %}
  {% load comments %}
    <div class="content">
    </div>
  {% endblock %}

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks Oleg, could you please try the new beta 2.09 and see if that is a bit better?

Changed in nxhtml:
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Oleg Lomaka (olomix) wrote :

Thanks for help. I've installed latest nightly build of emacs with rev 744, 2.09 beta (as beta doesn't work with emacs 23.1).

Looks like indent problem is fixed. If I use reserved words as part of my custom tags names, the indentation work as expected. But highlighting still incorrect. I'm not sure it concerns exactly this issue. Just in case, I've attached example screenshot.

Also I've experienced another bug with using templates variables and mumamo in beta and submitted another but #692290.

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks, Oleg.

Could you please tell me what problem you have using nXhtml with Emacs 23.1? (I can test myself here, but it would be good to know what problems you have seen.)

I have tried to fix the highlighting. Please try the new beta 2.09.

Changed in nxhtml:
status: In Progress → Fix Committed
Revision history for this message
Oleg Lomaka (olomix) wrote :

Looks like highlighting issue is resolved. Thanks.

As to latest stable emacs 23.2, mumamo uses a new function syntax-propertize-function, that was introduced in emacs cvs brunch and thus don't exists on 23.2 version. Actually this is another issue, I can file another ticket, if you want. I was thinking 2.09 beta doesn't suppose to work with non-cvs emacs.

If it would be helpful, here is the backtrace from emacs 23.2 opening a html file with 2.09 beta nxhtml:

MU:mumamo-fontify-region: Symbol's value as variable is void: syntax-propertize-function
** In buffer 1.html
  backtrace()
  (let ((standard-output standard-output)) (backtrace))
  (progn (let (...) (backtrace)) (with-current-buffer standard-output (buffer-string)))
  (unwind-protect (progn (let ... ...) (with-current-buffer standard-output ...)) (kill-buffer standard-output))
  (let ((standard-output ...)) (unwind-protect (progn ... ...) (kill-buffer standard-output)))
  (with-output-to-string (backtrace))
  (let ((format-string2 ...) (bt ...)) (mumamo-message-with-face (concat ... "
" ... bt) (quote highlight)) (apply (quote message) format-string2 lwarn-type args) (run-with-idle-timer 1 nil (quote mumamo-show-report-message)) (when mumamo-display-error-stop (setq font-lock-mode nil) (when ... ...) (when ... ...) (apply ... format-string2 lwarn-type args)))
  mumamo-display-error(mumamo-fontify-region "%s" "Symbol's value as variable is void: syntax-propertize-function")
  (condition-case err (mumamo-fontify-region-1 start end verbose) (error (mumamo-display-error ... "%s" ...)))
  (if (not mumamo-use-condition-case) (let* (... ...) (mumamo-fontify-region-1 start end verbose)) (condition-case err (mumamo-fontify-region-1 start end verbose) (error ...)))
  (mumamo-condition-case err (mumamo-fontify-region-1 start end verbose) (error (mumamo-display-error ... "%s" ...)))
  (if (and mumamo-just-changed-major nil (= 0 ...)) (mumamo-display-error (quote mumamo-fontify-region) "Just changed major, should not happen") (mumamo-condition-case err (mumamo-fontify-region-1 start end verbose) (error ...)))
  mumamo-fontify-region(1 105 nil)
  font-lock-fontify-region(1 105)
  run-hook-with-args(font-lock-fontify-region 1 105)
  byte-code("\302\303 #\207" [start next run-hook-with-args jit-lock-functions] 4)
  jit-lock-fontify-now(1 501)
  jit-lock-function(1)
  (let ((ret ...)) (mumamo-msgfntfy "mumamo-jit-lock-function EXIT %s, ff=%s, just-changed=%s" start (when start ...) mumamo-just-changed-major) ret)
  mumamo-jit-lock-function(1)

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks. The intention is to keep backward compatibility as long as possible if it it not too much trouble.

I have tried to fix this problem with backward compatibility now.

Revision history for this message
Oleg Lomaka (olomix) wrote :

I see you have committed the patch for versions less then 23.1. But I have the current stable 23.2. And it still doesn't work here, as syntax-propertize-function was introduced in cvs (23.3 or 24.0).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.