From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#6556: html-mode does not align to prev non-empty line when indenting Date: Sat, 3 Jul 2010 12:44:19 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1278154789 25471 80.91.229.12 (3 Jul 2010 10:59:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 3 Jul 2010 10:59:49 +0000 (UTC) To: 6556@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 03 12:59:47 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OV0Rl-00026v-P5 for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Jul 2010 12:59:46 +0200 Original-Received: from localhost ([127.0.0.1]:33000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OV0Rl-0008D3-3x for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Jul 2010 06:59:45 -0400 Original-Received: from [140.186.70.92] (port=43705 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OV0Re-0008Cy-Dz for bug-gnu-emacs@gnu.org; Sat, 03 Jul 2010 06:59:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OV0Rd-0003zt-8G for bug-gnu-emacs@gnu.org; Sat, 03 Jul 2010 06:59:38 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46753) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OV0Rd-0003zo-6l for bug-gnu-emacs@gnu.org; Sat, 03 Jul 2010 06:59:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OV0DW-0005ji-Az; Sat, 03 Jul 2010 06:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Jul 2010 10:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6556 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6556-submit@debbugs.gnu.org id=B6556.127815388822030 (code B ref 6556); Sat, 03 Jul 2010 10:45:02 +0000 Original-Received: (at 6556) by debbugs.gnu.org; 3 Jul 2010 10:44:48 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OV0DH-0005jH-VA for submit@debbugs.gnu.org; Sat, 03 Jul 2010 06:44:48 -0400 Original-Received: from mail-ew0-f44.google.com ([209.85.215.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OV0DF-0005jB-EH for 6556@debbugs.gnu.org; Sat, 03 Jul 2010 06:44:45 -0400 Original-Received: by ewy22 with SMTP id 22so1221911ewy.3 for <6556@debbugs.gnu.org>; Sat, 03 Jul 2010 03:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=Niw/hoWxvnCsyAL5AtRAzQ3SWbYYyAWpqoCL1GH49GA=; b=wJzZER2x1isdXsEmhFRTufTGk1Uo7eEON2Mbq4Z1DMkjpbhH94wcc9RSdgxQaHtf7z rA2BksC6tgRDVKmReRD+fB1VcZZSt3iFv50g6P7qomnCFhuRGtCxpOvxWm+Ex06g02AX 3wynWtjDVUAyY5wEnd4AgPpwDFeeD40n1lk8g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=hqPIz3d5lrZp0tl4fviHA8nXQXoUTcZ9dCyOxjXmvLFqitFqCD47MfrYvHEy4DUrQO 5EkQXrsoLZv2LpQZv81dovJtviktIBPYAGrzw2VJ/At1tfJ/yccxzzmpGM11+7C3OiXh jm3tgQQjPJwCdp2ZjoINwwzNQRrSa+1cTNgRY= Original-Received: by 10.213.34.19 with SMTP id j19mr84931ebd.63.1278153879479; Sat, 03 Jul 2010 03:44:39 -0700 (PDT) Original-Received: by 10.213.15.132 with HTTP; Sat, 3 Jul 2010 03:44:19 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 03 Jul 2010 06:45:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38210 Archived-At: On Sat, Jul 3, 2010 at 2:14 AM, Lennart Borgman wrote: > In a buffer like this > > =C2=A0

> =C2=A0 =C2=A0 =C2=A0row 1 > =C2=A0 =C2=A0 =C2=A0 =C2=A0 row 2 > =C2=A0 =C2=A0 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: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(context > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; If possible, align on the pr= evious non-empty text line. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Otherwise, do a more serious= parsing to find the > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; tag(s) relative to which we = should be indenting. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (and (not unclosed) (skip-c= hars-backward " \t") > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(< (skip-chars-backward " \t\n") 0) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(back-to-indentation) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(> (point) (cdr lcon))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nil > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char here) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (nreverse (sgml-get-cont= ext (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 > > A test for beginning of buffer is needed too since we are looking for non-blank lines (not non-empty as the comment says): (not (bobp)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pro= gn > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(back-to-indentation) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(> (point) (cdr lcon)))) > > > seems to work as expected. > > > >