Patches for Zen-Coding Plug-in for Emacs

Recently I was appointed to become the maintainer of the zen-coding plugin for Emacs after I submitted several patches for it. What the patches do:

  • #id and .classes can now be used without specifying the tag name (it will default to div).
  • Automatically self-close self-closing tags (br, img, input) except if it has child(ren). The latter is useful when you are writing xml that happens to have tags named br/img/input.
  • Support for quoted attribute value (E attr=”value”), useful if the attribute value contains special characters, such as parentheses.
  • Tag expander syntax support (E+) automatically expands tags that have obvious children (table, ol, ul, dl). For example ul+ will be expanded to <ul><li></li></ul>.
  • Improved formatting (indentation and newlines).
  • Added filters support. Implemented filters (other than html) are:
    • c (comments for elements with #id or .classes).
    • haml.
    • hic (clojure’s hiccup).
    • e (escape xml-unsafe characters < > and &).

If you are writing html/haml/hiccup using Emacs, you might find the plugin useful. Check it out. Contributions are welcomed.

3 thoughts on “Patches for Zen-Coding Plug-in for Emacs

  1. zen-coding for emacs is great, and has become a vital part of my web coding environment.

    There is one feature I wish it had. I’d code it up myself if I had a clue when it comes to lisp:
    When I’m marking up documents with any amount of complexity, I put comments at the end of all of my major containers, so I know where I am.

    So my ‘#cart’ or ‘#header.col’ will have a comment saying “cart ends here”. I do this a lot.
    It’d be great if zen-coding for emacs had a switch, so that when activated, the author could indicate that they want the end of the container commented.

  2. hi, thanks for your working…

    i have a question about keymap for zencoding-expand-line. i do not want to use C-j for that…

    how can i customize that keymap? i tried many ways, but always failed.

    thanks .

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s