From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John Ciolfi via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73206: 28.2; xml comment with blank lines to do not indent correctly, nxml-mode.el Date: Thu, 12 Sep 2024 13:53:26 -0400 Message-ID: Reply-To: ciolfi@mathworks.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21104"; mail-complaints-to="usenet@ciao.gmane.io" To: 73206@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 12 20:04:12 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sooAs-0005Fu-GN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Sep 2024 20:04:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sooAg-0005cz-Hb; Thu, 12 Sep 2024 14:03:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sooAe-0005UQ-C1 for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2024 14:03:56 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sooAd-0007Ut-Qf for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2024 14:03:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=vB4EGaOyAEydtZcT6Xisu5N9OuISHXqAx+9Rne02hLI=; b=ZMCeHuc/HqUvB7Tr5l12+Ju2I6S1BZgKojkk4Yp3HB3WqW+DTZpEB35XQCd22uUgl/wB+cycI3Elg+3boETkiy1aZaFO16gFglA01JtA/yMaHfuTyUhyJ2axzv46AKocPGPTstsicJt3LRzMZORVRWxNg07iRaZ98KoZ25IDx0i1aMWvtTeD6DYo/9kRSwGiWJrmeT81G0kqeq/eKhXSGzXbVuhdSbiZ5xxUQaBV42okG9zP6ZT5TpGYL2s5pHXxlMSlKjt1+hnyc50IP3EMdXBCl5PGNxYsPuB2NjEboihw/LcarJDLpWNQCiGnhuIXD5LiUAw+wnpUN0oiOGG6Zg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sooAl-0000Ff-PT for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2024 14:04:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Ciolfi Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Sep 2024 18:04:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73206 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Original-Received: via spool by submit@debbugs.gnu.org id=B.1726164201842 (code B ref -1); Thu, 12 Sep 2024 18:04:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 12 Sep 2024 18:03:21 +0000 Original-Received: from localhost ([127.0.0.1]:41887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sooA4-0000DQ-36 for submit@debbugs.gnu.org; Thu, 12 Sep 2024 14:03:21 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:33484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1soo2F-0008Du-6m for submit@debbugs.gnu.org; Thu, 12 Sep 2024 13:55:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soo26-00011f-1K for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2024 13:55:06 -0400 Original-Received: from us-smtp-delivery-120.mimecast.com ([170.10.129.120]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soo22-0006eP-84 for bug-gnu-emacs@gnu.org; Thu, 12 Sep 2024 13:55:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mathworks.com; s=mimecast20180117; t=1726163701; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type; bh=vB4EGaOyAEydtZcT6Xisu5N9OuISHXqAx+9Rne02hLI=; b=Z/UR+YTGqlOg87vBfCIcWha+BIR6zfWDFtczFj9zuOQ5TKMlkeH95cJbP7fggl8vfi3H+S g43biyQlf+aARUHFwsTSLQ+vimUZHZEsL8RwGF6EUo3fsBcPH66MSbp/Oyi2TpxzaYGXPP XkNd77qjmK8kHr+W/iWNIdRYxYh3dSA= Original-Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazlp17010007.outbound.protection.outlook.com [40.93.13.7]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-12-cWPxfctXN_21L25BxK1McQ-1; Thu, 12 Sep 2024 13:53:48 -0400 X-MC-Unique: cWPxfctXN_21L25BxK1McQ-1 Original-Received: from DM6PR04CA0009.namprd04.prod.outlook.com (2603:10b6:5:334::14) by SN7PR05MB7757.namprd05.prod.outlook.com (2603:10b6:806:f6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.18; Thu, 12 Sep 2024 17:53:43 +0000 Original-Received: from DS1PEPF0001709C.namprd05.prod.outlook.com (2603:10b6:5:334:cafe::4c) by DM6PR04CA0009.outlook.office365.com (2603:10b6:5:334::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.24 via Frontend Transport; Thu, 12 Sep 2024 17:53:43 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 144.212.100.35) smtp.mailfrom=mathworks.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=mathworks.com Original-Received: from exedge.mathworks.com (144.212.100.35) by DS1PEPF0001709C.mail.protection.outlook.com (10.167.18.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Thu, 12 Sep 2024 17:53:43 +0000 Original-Received: from EX1901AH.mathworks.com (172.31.53.42) by EX19EDGE00AH.mathworks.com (172.31.187.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 12 Sep 2024 13:54:39 -0400 Original-Received: from EX1901AH.mathworks.com (172.31.53.42) by EX1901AH.mathworks.com (172.31.53.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 12 Sep 2024 13:53:26 -0400 Original-Received: from mail-vif.mathworks.com (144.212.95.101) by EX1901AH.mathworks.com (172.31.53.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11 via Frontend Transport; Thu, 12 Sep 2024 13:53:26 -0400 Original-Received: from ah-ciolfi-l.dhcp.mathworks.com (ah-ciolfi-l.dhcp.mathworks.com [172.21.82.138]) by mail-vif.mathworks.com (8.14.7/8.14.7) with ESMTP id 48CHrQKO000971; Thu, 12 Sep 2024 13:53:26 -0400 Original-Received: from ah-ciolfi-l.dhcp.mathworks.com (localhost [127.0.0.1]) by ah-ciolfi-l.dhcp.mathworks.com (8.17.1.9/8.17.1.9/Debian-2+deb12u2) with ESMTP id 48CHrQ7h1859260; Thu, 12 Sep 2024 13:53:26 -0400 Original-Received: (from ciolfi@localhost) by ah-ciolfi-l.dhcp.mathworks.com (8.17.1.9/8.17.1.9/Submit) id 48CHrQ461859248; Thu, 12 Sep 2024 13:53:26 -0400 X-Authentication-Warning: ah-ciolfi-l.dhcp.mathworks.com: ciolfi set sender to ciolfi@mathworks.com using -f X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709C:EE_|SN7PR05MB7757:EE_ X-MS-Office365-Filtering-Correlation-Id: e9d5b2e5-8d83-46d5-0361-08dcd353d793 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|82310400026|376014 X-Microsoft-Antispam-Message-Info: hnI12EtSu7nH+YGTmTZ97JDMG26MtQsRUIcMuB803sp9/pAxE97R5/95alfN4p3TssOvnZE78m62avEvBH6+K6n2lnuJtZorbogLiM+fN0EPoF89KW7oBRVgQwGI+l/pwrh9RUe6ZYjq9/jjj4sajr1WyZdQcX+ztr73PI5gaxRFNMCFnpdWMLRtBw2yMdU/iJ3ZLXCAnwnOCr4zzTnhh0Zxg993/sWq9qu70jwOymgC6CoO5eIqBTynp1QTv/lBv9RzYSJ0+6asnlKA4cdIjg8vObyujtZ2l+xjt3RPLCZRD5T2UosDbLp37twoNpx52IA3wrPJzoHhGaVZosM4PJG9XbdHXa57ETG5Imt3MqsGF+MuUVT30ZU66NLnYGvLzntICdYNiSvGylUtefPZNQlqYumCb5iaiwNueukMUhoZYhiBtAxgsDsZMw4y4xmWQ/7G1ICjyL0XCp0rMGFDSxRQIDRd7nsoSL8BRv4BS85zCFCzIndCyNvaE7YGPal9QzG1cWnwHviEq42FW/1l9DnWY3m+fBD9svFQ4mEcdp+gAacmljmGPQ+btDw+Bliu637/zozxm6iK9ufm6j7t9McwgbsVKfmg6RyJgO+ioX1PEycQQRfX1m62YRyFYSHxg6smeU04b8vLBjkKJVw4h+AcE4KWNecvFfOKhNKGxN1XZvhkpxPkx59Pw6yjwOHgNAsvXAXi7xgjyIyj2+Rlg4zyYGWxfXTLWdY4LWdWhpWzh7YgXxZ+azdcSMDr7 WXRVzXHBfz9jU5bO/UTBHH+6T9aOUG0E6vwsdCvO1aq5bQlq7woKMjh6aFujkk8HS9T1gfTZQ+XZdovsSj5N3fK/MTj6x1fOYW X-Forefront-Antispam-Report: CIP:144.212.100.35; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:exedge.mathworks.com; PTR:mxgw-ah.mathworks.com; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: NAUaI/QMrG7tzGvuVj0DReHHRZT3DiZkYBxTP4IBHaO8PsTLXDM1pSzh1APZJvBwbfJXEwOa7+K1Y5GhOEjSkL3malWGu9XuHbf6PynaEDjcOXXE2/E5mvr68ZTyt4qDutIXmwtZYmS3jyLOh8lZh606schGV2fnk1guUFlJMpps0UWerkxbrqiag39GHO70TbLnFnBVpe6nWjmWDw5x9C0ZTKs8R5XXv1HJo+3nuFWHG3K39Y6pV6rhYndE2+GDavBDpC2ZnlaxOWIvQeD0cokA/E9MmfKbrguXGtspZvTf1mTv6Xo6QuB/wYVFbsqhkxlXsu0L/y1KnAPAvAMhsAiO0M8pMY6e3KKt8sPUGapCfMsFYEpfToaq1kYqNsmI1L52JW7A045AGbUpX3cT8wFly6AQirVlNVsBR43EdrW7XLxHNYsyblyLJnQO1GUhJql7sCd36r98TL2OpqlS8HWefOHw3nsDkn01AgaQOkRNOv/1Z/XeoxZ4y8hmpgzM3bxjWlRq68F+Im6kzZecibBoVf8RNsMnixI2g/t2/16BwfaiK7VmyHZ74vWcazKG+E6ozLrEaX2wABPar468ri+tyxfu7i6QD51tguvzMFQ= X-OriginatorOrg: mathworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2024 17:53:43.0687 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9d5b2e5-8d83-46d5-0361-08dcd353d793 X-MS-Exchange-CrossTenant-Id: 99dd3a11-4348-4468-9bdd-e5072b1dc1e6 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=99dd3a11-4348-4468-9bdd-e5072b1dc1e6; Ip=[144.212.100.35]; Helo=[exedge.mathworks.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709C.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR05MB7757 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: mathworks.com Received-SPF: pass client-ip=170.10.129.120; envelope-from=ciolfi@mathworks.com; helo=us-smtp-delivery-120.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 12 Sep 2024 14:03:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , X-ACL-Warn: , John Ciolfi Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291635 Archived-At: --=-=-= Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable 1. Create foo.xml containing: Notice that we have a blank line in the xml comment. 2. Put the point on 'bar' and press TAB. Notice that the 'bar' line is not indented correctly. Solution -------- The problem is that in nxml-compute-indent-in-delimited-token, there is a (forward-line -1) which assumes that the prior line is indented. In this case the prior line is a blank line and thus doesn't have indentation. After the (forward-line -1), we need to keep going back until we see a non-blank line: =09 (forward-line -1) + (while (looking-at "^[:blank:]*$") +=09 (forward-line -1)) Attached is a patch for nxml-mode.el that fixes the issue.=20 Thanks John In GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cair= o version 1.16.0) of 2024-06-25, modified by Debian built on x86-conova-01 Windowing system distributor 'The X.Org Foundation', version 11.0.12101006 System Description: Debian GNU/Linux 12 (bookworm) Configured using: 'configure --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/libexec --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/28.2/site-lisp:= /usr/local/share/emacs/site-lisp:/usr/share/emacs/28.2/site-lisp:/usr/share= /emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --with-native-compilation --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/libexec --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --with-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/28.2/site-lisp:= /usr/local/share/emacs/site-lisp:/usr/share/emacs/28.2/site-lisp:/usr/share= /emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --with-native-compilation --with-cairo --with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2 -ffile-prefix-map=3D/build/reproducible-path/emacs-28.2+1=3D. -fstack-prot= ector-strong -Wformat -Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' LDFLAGS=3D-Wl,-z,relro' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 68059 5432) (symbols 48 6639 0) (strings 32 19490 1559) (string-bytes 1 664189) (vectors 16 13926) (vector-slots 8 297636 11873) (floats 8 22 31) (intervals 56 258 0) (buffers 992 10)) --=-=-= Content-Type: text/x-diff; name=nxml-mode.el.patch; charset=WINDOWS-1252 Content-Disposition: inline; filename="nxml-mode.el.patch" Content-Description: nxml-mode.el.patch Content-Transfer-Encoding: quoted-printable --- ./orig/nxml-mode.el=092024-09-12 09:10:46.580451579 -0400 +++ nxml-mode.el=092024-09-12 09:04:48.473571128 -0400 @@ -1522,6 +1522,8 @@ =09((progn =09 (goto-char pos) =09 (forward-line -1) + (while (looking-at "^[:blank:]*$") +=09 (forward-line -1)) =09 (<=3D (point) xmltok-start)) =09 (goto-char (+ xmltok-start (length open-delim))) =09 (when (and (string=3D open-delim "