[Top][All Lists]

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

indenting in nxml-mode

From: Joseph Mingrone
Subject: indenting in nxml-mode
Date: Fri, 15 Jul 2016 22:30:19 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (berkeley-unix)


I posted a question on emacs.stackexhcange.com about indenting in nxml-mode.


My goal was to configure indenting to conform to the style guide described here.


It seems this was not possible without some hacking.

I have given it a (very) preliminary attempt.  I suspect there are cases I
haven't considered, but after some light testing, it seems to be working.

(defun nxml-compute-indent-from-matching-start-tag ()
  "Compute the indent for a line using the matching start-tag."
    (let ((bol (point)) (bol-xmltok-type xmltok-type))
       (condition-case nil
            (point) t (- (point) nxml-end-tag-indent-scan-distance))
         (nxml-scan-error nil))
       (< xmltok-start bol)
         (goto-char xmltok-start)
         (skip-chars-backward " \t")
       (if (memq bol-xmltok-type
                 '(data empty-element partial-start-tag start-tag ))
           (+ (current-indentation) nxml-child-indent)

What problems am I missing?


Attachment: signature.asc
Description: PGP signature

reply via email to

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