Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 code staining chokes on multiline comments

open
Tony Graham
None
5
2001-11-16
2001-11-10
derek reillyn
No

Hi --

I love stained xsl

Anyway, using emacs 20.7 I find that 'commenting out' chunks of xsl only works reliably (in terms of xslide handling staining and tabbing correctly) when there are no newlines between <!-- and -->

Discussion

  • Tony Graham
    Tony Graham
    2001-11-16

    • assigned_to: nobody --> menteith
     
  • Glen Peterson
    Glen Peterson
    2003-04-05

    Logged In: YES
    user_id=750563

    I have a fix for this. I'll try to post it soon.

     
  • Glen Peterson
    Glen Peterson
    2003-04-11

    Logged In: YES
    user_id=750563

    Here's a fix for multi-line comment staining.

    In xslide-font.el:

    Remove:
    ; ;;
    ; ;; Put comment patterns last so they mask anything
    ; ;; that might be inside the comment
    ; ;;
    ; '("\\(<!--[^-]*\\(-[^-]+\\)*-->\\)"
    ; (1 font-lock-comment-face t))

    Add:
    ;; Put comment patterns last so they mask anything
    ;; that might be inside the comment
    ; the following creates a loop on finding <!-- ... >
    ;'("\\(<!--[^-]\\([^-]+\\|\\n\\|-[^-]\\)*-->\\)"
    ; this creates a loop on finding <!-- ... -->
    ;'("\\(<!--[^-]\\([^-]+\\|\\n\\|-[^-]\\)+>\\)"
    ; This highlights this comment start to finish, or up to the
    start of the
    ; next comment and doesn't create a loop.
    '("\\(<!--[^-]\\([^-]+\\|\\n\\|-[^-]\\)+\\(>\\|-->\\)\\)"
    (1 font-lock-comment-face t)
    )

     
  • Glen Peterson
    Glen Peterson
    2003-04-11

    Logged In: YES
    user_id=750563

    Whoops! You'll have to replace the ampersand-quot-
    semicolon with a regular double-quote. This is kind of a
    difficult way to submit changes.