emacs-devel
[Top][All Lists]
Advanced

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

Re: /srv/bzr/emacs/trunkr101338:*lisp/emacs-lisp/syntax.el(syntax-ppss):


From: E Sabof
Subject: Re: /srv/bzr/emacs/trunkr101338:*lisp/emacs-lisp/syntax.el(syntax-ppss): More sanitycheck to catchcatch
Date: Tue, 18 Feb 2014 06:54:45 +0000
User-agent: mu4e 0.9.9.6pre2; emacs 24.3.50.4

Dmitry Gutov <address@hidden> writes:

> E Sabof <address@hidden> writes:
>
>> Might the effect be the same, if each chunk increased or decreased the depth?
>
> Some chunks create a "temporary" outdent:
>
> <% if foo %>
>   <p>woo</p>
> <% else %>
>   <p>wah wah</p>
> <% end %>

The depth is meant to be treated as a "baseline", not a rule. Closing "things", 
are usually indented at

(1- (nth 0 (syntax-ppss (line-beginning-position))))

That this is the "correct" way to indent might be subject to dispute, but here 
is an example where the depth is ignored altogether.

<!DOCTYPE html>
<html lang="en-gb" > (incf depth)
  <head> (incf depth)
    <style type="text/css"> (incf depth)
(setq depth-store depth
      depth 0)
body {
  color: green;
}
(setq depth depth-store)
    </style> (decf depth)
  </head> (decf depth)
</html> (decf depth)

Evgeni



reply via email to

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