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#5127: Indentation of top level tags when no single top level tag Date: Sat, 5 Dec 2009 00:17:40 +0100 Message-ID: Reply-To: Lennart Borgman , 5127@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001636ed74209fac2f0479ef51bf X-Trace: ger.gmane.org 1259969314 22226 80.91.229.12 (4 Dec 2009 23:28:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Dec 2009 23:28:34 +0000 (UTC) To: Emacs Bugs Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 05 00:28:27 2009 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.50) id 1NGhZa-0000kg-N3 for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2009 00:28:27 +0100 Original-Received: from localhost ([127.0.0.1]:46635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGhZZ-0008I7-JZ for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 Dec 2009 18:28:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGhYj-0007gQ-BB for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:27:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGhYe-0007c0-FQ for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:27:32 -0500 Original-Received: from [199.232.76.173] (port=40967 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGhYd-0007bZ-PO for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:27:27 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:42267) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NGhYd-0001OQ-3L for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:27:27 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB4NROHA006958; Fri, 4 Dec 2009 15:27:25 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nB4NP60a006683; Fri, 4 Dec 2009 15:25:06 -0800 Resent-Date: Fri, 4 Dec 2009 15:25:06 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Lennart Borgman Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 04 Dec 2009 23:25:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 5127 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12599686886151 (code B ref -1); Fri, 04 Dec 2009 23:25:06 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 4 Dec 2009 23:18:08 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB4NI617006148 for ; Fri, 4 Dec 2009 15:18:07 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGhPZ-0007RE-LN for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:18:05 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGhPV-0007NE-VY for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:18:05 -0500 Original-Received: from [199.232.76.173] (port=50140 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGhPV-0007N0-N5 for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:18:01 -0500 Original-Received: from mail-yw0-f196.google.com ([209.85.211.196]:33744) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGhPV-0000R1-Bf for bug-gnu-emacs@gnu.org; Fri, 04 Dec 2009 18:18:01 -0500 Original-Received: by ywh34 with SMTP id 34so2732143ywh.1 for ; Fri, 04 Dec 2009 15:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=CcgmSVF9NUH7OcM2vkPOl+kn+hgajLmT/f7BIryiV8U=; b=e3VtB5d+KFkfJUxzjOB1QqMaVreWXYMNUs/bBUSBbeFxbIqTmuQjeYa7n7dOu/SeZc 7XQc9lY0A3J6NL2eYUCJ/UulD8GNLlsaBiiuRK9/Miq3guOoTYgJNRJ+Ha5EpM2f2zE+ i0YbrBGGXkjAAfbAG1FZkAQ0X28AnkhQtCxFc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=iIJaB0WdyTCQRkPoxZq9MlwegpemVTiYsuyTaDbuMT393t/d9dkFbQdXIWHZWePMNe TF3OnEbnkp9vsY/5VpC4QV01JoeM+FQVKA84iJpaiSfb7R6pRgZqzDETq608XH6s4faZ py8SU60I44yDpyyccIRnnsby98yzYn2+36jKg= Original-Received: by 10.101.111.20 with SMTP id o20mr4867661anm.185.1259968680405; Fri, 04 Dec 2009 15:18:00 -0800 (PST) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 04 Dec 2009 18:27:32 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:33223 Archived-At: --001636ed74209fac2f0479ef51bf Content-Type: text/plain; charset=UTF-8 Sometimes a user is working with part of a code and still want to do indentation. In cases like this the body tag will currently be intended to column 0 by sgml-indent-line. The attached patch handles this particular case specially to avoid that. Since I do not want to change the return values from sgml-geet-context (which is where this situation best can be detected) I have transferred the extra information in a global variable sgml-get-context-last-close instead. This is against a checkout from 2009-12-04. --001636ed74209fac2f0479ef51bf Content-Type: text/x-diff; charset=US-ASCII; name="indent-outermost.patch" Content-Disposition: attachment; filename="indent-outermost.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g2tkrtfz0 SW5kZXg6IHNnbWwtbW9kZS5lbA0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KUkNTIGZpbGU6IC9zb3VyY2VzL2VtYWNz L2VtYWNzL2xpc3AvdGV4dG1vZGVzL3NnbWwtbW9kZS5lbCx2DQpyZXRyaWV2aW5nIHJldmlzaW9u IDEuMTQ1DQpkaWZmIC1jIC1yMS4xNDUgc2dtbC1tb2RlLmVsDQoqKiogc2dtbC1tb2RlLmVsCTMx IE9jdCAyMDA5IDIxOjUyOjU2IC0wMDAwCTEuMTQ1DQotLS0gc2dtbC1tb2RlLmVsCTQgRGVjIDIw MDkgMjM6MDQ6MDYgLTAwMDANCioqKioqKioqKioqKioqKg0KKioqIDEyNjUsMTI3MCAqKioqDQot LS0gMTI2NSwxMjc0IC0tLS0NCiAgICAgICAgKGdvdG8tY2hhciB0YWctc3RhcnQpDQogICAgICAg IChzZ21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nQtdGFnDQogICAgICAgICAoKGVxIChzZ21sLXRh Zy10eXBlIHRhZy1pbmZvKSAnb3BlbikNCisgICAgICAgICAod2hlbiAoYW5kIChudWxsIHN0YWNr KQ0KKyAgICAgICAgICAgICAgICAgICAgbGFzdC1jbG9zZSkNCisgICAgICAgICAgIChzZXRxIGxh c3QtY2xvc2UgJ25vLXVzZSkpDQogIAkoY29uZA0KICAJICgobnVsbCBzdGFjaykNCiAgCSAgKGlm IChhc3NvYy1zdHJpbmcgKHNnbWwtdGFnLW5hbWUgdGFnLWluZm8pIGlnbm9yZSB0KQ0KKioqKioq KioqKioqKioqDQoqKiogMTM1NCwxMzYzICoqKioNCi0tLSAxMzY0LDEzODkgLS0tLQ0KICAgICAg ICAgKChlcSAoc2dtbC10YWctdHlwZSB0YWctaW5mbykgJ2Nsb3NlKQ0KICAJKGlmIChzZ21sLWVt cHR5LXRhZy1wIChzZ21sLXRhZy1uYW1lIHRhZy1pbmZvKSkNCiAgCSAgICAobWVzc2FnZSAiU3B1 cmlvdXMgPC8lcz46IGVtcHR5IHRhZyIgKHNnbWwtdGFnLW5hbWUgdGFnLWluZm8pKQ0KKyAgICAg ICAgICAgOzsgS2VlcCB0cmFjayBvZiBsYXN0IGNsb3NlIGlmIGNvbnRleHQgd2lsbCByZXR1cm4g bmlsDQorICAgICAgICAgICAod2hlbiAoYW5kIChub3QgbGFzdC1jbG9zZSkNCisgICAgICAgICAg ICAgICAgICAgICAgKG51bGwgc3RhY2spDQorICAgICAgICAgICAgICAgICAgICAgICg+IGhlcmUg KHBvaW50LWF0LWVvbCkpDQorICAgICAgICAgICAgICAgICAgICAgIChsZXQgKChoZXJlIChwb2lu dCkpKQ0KKyAgICAgICAgICAgICAgICAgICAgICAgIChnb3RvLWNoYXIgKHNnbWwtdGFnLXN0YXJ0 IHRhZy1pbmZvKSkNCisgICAgICAgICAgICAgICAgICAgICAgICAoc2tpcC1jaGFycy1iYWNrd2Fy ZCAiIFx0IikNCisgICAgICAgICAgICAgICAgICAgICAgICAocHJvZzENCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgKGJvbHApDQorICAgICAgICAgICAgICAgICAgICAgICAgICAoZ290by1j aGFyIGhlcmUpKSkpDQorICAgICAgICAgICAgIChzZXRxIGxhc3QtY2xvc2UgdGFnLWluZm8pKQ0K KyANCiAgCSAgKHB1c2ggKHNnbWwtdGFnLW5hbWUgdGFnLWluZm8pIHN0YWNrKSkpDQogICAgICAg ICApKQ0KICANCiAgICAgIDs7IHJldHVybiBjb250ZXh0DQorICAgICAoc2V0cSBzZ21sLWdldC1j b250ZXh0LWxhc3QtY2xvc2UNCisgICAgICAgICAgICh3aGVuIChhbmQgbGFzdC1jbG9zZQ0KKyAg ICAgICAgICAgICAgICAgICAgICAobm90IChlcSBsYXN0LWNsb3NlICduby11c2UpKSkNCisgICAg ICAgICAgICAgKHNnbWwtdGFnLXN0YXJ0IGxhc3QtY2xvc2UpKSkNCiAgICAgIGNvbnRleHQpKQ0K ICANCiAgKGRlZnVuIHNnbWwtc2hvdy1jb250ZXh0ICgmb3B0aW9uYWwgZnVsbCkNCioqKioqKioq KioqKioqKg0KKioqIDE1MDgsMTUxNCAqKioqDQogIAkgICAgICAoPCAocG9pbnQpIGhlcmUpIChz Z21sLWF0LWluZGVudGF0aW9uLXApKQ0KICAJIChjdXJyZW50LWNvbHVtbikpDQogIAkodA0KISAJ IChnb3RvLWNoYXIgdGhlcmUpDQogIAkgKCsgKGN1cnJlbnQtY29sdW1uKQ0KICAJICAgICgqIHNn bWwtYmFzaWMtb2Zmc2V0IChsZW5ndGggY29udGV4dCkpKSkpKSkNCiAgDQotLS0gMTUzNCwxNTQy IC0tLS0NCiAgCSAgICAgICg8IChwb2ludCkgaGVyZSkgKHNnbWwtYXQtaW5kZW50YXRpb24tcCkp DQogIAkgKGN1cnJlbnQtY29sdW1uKSkNCiAgCSh0DQohIAkgKGdvdG8tY2hhciAob3IgKGFuZCAo bnVsbCBjb250ZXh0KQ0KISAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNnbWwtZ2V0LWNv bnRleHQtbGFzdC1jbG9zZSkNCiEgICAgICAgICAgICAgICAgICAgICAgICAgdGhlcmUpKQ0KICAJ ICgrIChjdXJyZW50LWNvbHVtbikNCiAgCSAgICAoKiBzZ21sLWJhc2ljLW9mZnNldCAobGVuZ3Ro IGNvbnRleHQpKSkpKSkpDQogIA0K --001636ed74209fac2f0479ef51bf--