GNU bug report logs - #6556
html-mode does not align to prev non-empty line when indenting

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Sat, 3 Jul 2010 00:15:02 UTC

Severity: minor

Tags: unreproducible

Done: Tom Tromey <tom <at> tromey.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Subject: bug#6556: closed (works for me)
Date: Tue, 07 Feb 2017 03:44:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#6556: html-mode does not align to prev non-empty line when indenting

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 6556 <at> debbugs.gnu.org.

-- 
6556: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6556
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tom Tromey <tom <at> tromey.com>
To: 6556-done <at> debbugs.gnu.org
Subject: works for me
Date: Mon, 06 Feb 2017 20:43:00 -0700
I tried this and it works for me, so I'm closing this bug.

Tom

[Message part 3 (message/rfc822, inline)]
From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>
Subject: html-mode does not align to prev non-empty line when indenting
Date: Sat, 3 Jul 2010 02:14:23 +0200
In a buffer like this

   <p>
      row 1
         row 2
     row 3

the "row 3" gets indented like above. I think it instead should be
aligned with row2. (I need this for mumamo.)

The comment in sgml-calculate-indent seems to say that this is the
intention, but the code is maybe unfinished, line 1483:

	    (context
	     ;; If possible, align on the previous non-empty text line.
	     ;; Otherwise, do a more serious parsing to find the
	     ;; tag(s) relative to which we should be indenting.
	     (if (and (not unclosed) (skip-chars-backward " \t")
		      (< (skip-chars-backward " \t\n") 0)
		      (back-to-indentation)
		      (> (point) (cdr lcon)))
		 nil
	       (goto-char here)
	       (nreverse (sgml-get-context (if unclosed nil 'empty)))))

I do not know how it is supposed to work, but I notice that
(back-to-indentation) is not supposed to return anything special so
the argument to if may fail (and this seems to happen). Writing that
part as


                    (progn
		      (back-to-indentation)
		      (> (point) (cdr lcon))))


seems to work as expected.



This bug report was last modified 8 years and 165 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.