Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template syntax highlighting? #33

Closed
jrhorn424 opened this issue Feb 22, 2012 · 8 comments
Closed

Template syntax highlighting? #33

jrhorn424 opened this issue Feb 22, 2012 · 8 comments

Comments

@jrhorn424
Copy link

Syntax highlighting for templates looks the same as the usual html-mode, which is to say, template-tags aren't prettyfied.

Screenshot

Pony is on my path, required, and is being activated in the correct buffers. Am I missing something?

@davidmiller
Copy link
Owner

Pony is on my path, required, and is being activated in the correct
buffers. Am I missing something?

Could you post the value of
C-h v font-lock-defaults
when you run that from a template buffer that has the pony template mode
activated?

Also: what version of pony-mode are you using? (Did you install from
Marmalade or github etc, what is the value of the Version header in
pony-mode.el)

The indentation branch in Git has definitely gone through interim working
commits where this was broken, but AFAIK should be fine from master...

Love regards etc

David Miller

Love regards etc

David Miller
http://www.deadpansincerity.com
07854 880 883

@jrhorn424
Copy link
Author

C-h v font-lock-defaults:

font-lock-defaults is a variable defined in `font-core.el'.
Its value is (pony-tpl-font-lock-keywords)
Local in buffer survey_landing.html; global value is nil

I installed from github a few days ago. Version 0.3b in header. Git pull says I'm up-to-date.

@davidmiller
Copy link
Owner

Its value is (pony-tpl-font-lock-keywords)

:( That's what it was supposed to be... I'll make sure that everything's
clean and push back up - likely sometime tomorrow morning.

Love Regards etc

David Miller

Love regards etc

David Miller
http://www.deadpansincerity.com
07854 880 883

@davidmiller
Copy link
Owner

Running from git master this regression is "Fixed for Me" :)

So a fresh pull should fix this regression - and add some extra features like indentation of template tags (Which is new - bugs possible)

If you still have issues, feel free to re-open...

Love regards etc

@jrhorn424
Copy link
Author

I can confirm indenting works, but no syntax highlighting for me after pulling.

jrhorn424 at hook in ~/.emacs.d/src/pony-mode on master
$ git log
commit a3fc2e9983d18ce55a06e9b93973cb4cad5057d6
Author: David Miller <David>
Date:   Sat Feb 25 11:13:57 2012 +0000
<snip>

@davidmiller
Copy link
Owner

So I can't see you're screenshots - something's going wrong with your URl
shortener/cloud photo service but...

Next steps would be:

1 Ensure that nothing else is interfering with the highlighting:

  • there's a runquiet.sh script in the repo which loads a very minimal
    configuration - see if the highlighting works in that file
    2 Provide a template file so that I can try to reproduce the problem
    3 Provide the output of $tree /your/project/root
    4 Check the value of font-lock-keyword-face
    5 Run M-x describe-face while (point) is over something that should be
    highlighted

Love regards etc

David Miller
http://www.deadpansincerity.com
07854 880 883

@jrhorn424
Copy link
Author

Thanks a lot for helping me troubleshoot.

  1. No syntax highlighting with runquiet: http://cl.ly/EYrr
  2. Here's an example template:
{% extends 'base.html' %}

{% block content %}
  <h1>Survey Page</h1>
  <p>
    Finally, we will ask you a few survey questions. After completing the
    survey, you may proceed to the experimenter to collect your payment.
  </p>
  <a href="{% url survey:formwizard %}">Continue &gt;&gt;</a>
{% endblock content %}
  1. Here's the output of tree:
jrhorn424 at hook in ~/research/d/pp/apparatus/mysite
(env) $ tree

/Users/jrhorn424/research/d/pp/apparatus/mysite
   |-app
   |---models
   |-----fixtures
   |---static
   |-----lib
   |-------coffee
   |-------js
   |---templates
   |---tests
   |---views
   |-mach
   |---forms
   |---models
   |-----fixtures
   |---templates
   |---tests
   |---views
   |-mis
   |---forms
   |---models
   |-----fixtures
   |---templates
   |---tests
   |---views
   |-personality
   |---forms
   |---models
   |-----fixtures
   |---templates
   |---tests
   |---views
   |-raven
   |---forms
   |---models
   |-----fixtures
   |---templates
   |---tests
   |---views
   |-static
   |-survey
   |---templates
  1. font-lock-keyword-face
font-lock-keyword-face is a variable defined in `font-lock.el'.
Its value is font-lock-keyword-face
  1. describe-face wanted a face value (default was "default"; which tells me it wasn't picking up the template tag, since the point was on the extends keyword), so I did C-u C-x = instead:
             position: 32 of 316 (10%), column: 4
            character: l (displayed as l) (codepoint 108, #o154, #x6c)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x6C
               syntax: w        which means: word
             category:
                       .:Base, L:Left-to-right (strong), a:ASCII, l:Latin, r:Rom\
an
          buffer code: #x6C
            file code: #x6C (encoded by coding system undecided-unix)
              display: terminal code #x6C

Character code properties: customize what to show
  name: LATIN SMALL LETTER L
  general-category: Ll (Letter, Lowercase)
  decomposition: (108) ('l')

There are text properties here:
  fontified            t

@jrhorn424
Copy link
Author

Just thought to mention, since I hadn't already:

jrhorn424 at hook in ~/research/d/pp/apparatus/mysite
(env) $ uname -a
Darwin hook 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64 i386 MacBookPro7,1 Darwin

jrhorn424 at hook in ~/research/d/pp/apparatus/mysite
(env) $ emacs --version
GNU Emacs 24.0.93.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants