[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Alternative for html-mode (sgml-mode based) for editing HTML/JSP/Django/

From: Oleksandr Gavenko
Subject: Alternative for html-mode (sgml-mode based) for editing HTML/JSP/Django/Jinja/PHP.
Date: Sun, 13 Jan 2013 17:23:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

What mode useful for editing HTML files?

I use gsml based mode, but it outdated (in flavour of HTML 5) and don't show
docs for tags/attributes.

But I also create hacks for JSP file type (to get commenting working):

  (define-derived-mode jsp-mode html-mode "JSP"
    "JSP editing mode. Redefine HTML comment syntax to JSP."
    (setq comment-start "<%--")
    (setq comment-end "--%>")
    (setq comment-start-skip "<[!%]--[ \t]*")
    (setq comment-end-skip "[ \t]*--[% \t\n]*>")
    (setq jsp-font-lock-syntactic-keywords
          '(("\\(<\\)%--" (1 "< b"))
            ("--%\\(>\\)" (1 "> b"))))
    (setcdr (assoc 'font-lock-syntactic-keywords font-lock-defaults) 
'jsp-font-lock-syntactic-keywords) )

  (add-to-list 'auto-mode-alist '("\\.jspf?\\'" . jsp-mode))

Look like ugly hack...

I miss indentation of code in <script type="text/javascript"> and <style
type="text/css"> tags and code highlighting.

I miss proper code commenting in JSP/Django/PHP files...

Any suggestion?

Best regards!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]