tali713 / esxml

An elisp library for working with xml, esxml and sxml.
58 stars 14 forks source link

Specify indentation for esxml s-exps #13

Open aidalgol opened 11 years ago

aidalgol commented 11 years ago

It would be nice if esxml s-expressions were treated specially when indenting. To start with, I would like to have

(tag ()
     body)

automatically indented as

(tag ()
  body)

I'm not sure how do accomplish this, but so far it looks as if we'll need something like (put 'symbol 'lisp-indent-function INDENT-SPEC).

alphapapa commented 7 years ago

(declare (indent defun)) is usually the solution.

wasamasa commented 7 years ago

Yeah, but that's for individual functions/macros. What you'd need here is an indentation function that recognizes the context and adjusts indentation to be more DWIMish. The proposed alternative of declaring indentation for each possible tag symbol isn't exactly actionable (just how many do you think exist for XML?) and will backfire if a user ever decides to call a function html.