From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#18871: 24.4; nxml-mode: DTD edition breaks the file structure Date: Sat, 18 May 2019 19:22:13 -0400 Message-ID: <87k1encpqy.fsf@gmail.com> References: <878uk0qn46.fsf@ypig.lip.ens-lyon.fr> <87o93zd1xu.fsf@gmail.com> <20190518231117.GA10282@zira.vinc17.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="248806"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: 18871@debbugs.gnu.org To: Vincent Lefevre Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 19 01:23:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hS8fa-0012d8-74 for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 May 2019 01:23:14 +0200 Original-Received: from localhost ([127.0.0.1]:39765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hS8fY-00071j-LJ for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 May 2019 19:23:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hS8fP-000712-EA for bug-gnu-emacs@gnu.org; Sat, 18 May 2019 19:23:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hS8fO-0002se-EO for bug-gnu-emacs@gnu.org; Sat, 18 May 2019 19:23:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47918) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hS8fO-0002sP-9I for bug-gnu-emacs@gnu.org; Sat, 18 May 2019 19:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hS8fO-0004BR-0k for bug-gnu-emacs@gnu.org; Sat, 18 May 2019 19:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2019 23:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18871 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 18871-submit@debbugs.gnu.org id=B18871.155822174316023 (code B ref 18871); Sat, 18 May 2019 23:23:01 +0000 Original-Received: (at 18871) by debbugs.gnu.org; 18 May 2019 23:22:23 +0000 Original-Received: from localhost ([127.0.0.1]:33229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS8el-0004AN-Dx for submit@debbugs.gnu.org; Sat, 18 May 2019 19:22:23 -0400 Original-Received: from mail-it1-f195.google.com ([209.85.166.195]:39924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS8ei-0004AA-C1 for 18871@debbugs.gnu.org; Sat, 18 May 2019 19:22:22 -0400 Original-Received: by mail-it1-f195.google.com with SMTP id 9so17645924itf.4 for <18871@debbugs.gnu.org>; Sat, 18 May 2019 16:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vZ8ERwscEtxe0iYeRb79ncVDZg6SUy4QAmcBo884SlU=; b=Fg6AHLl0JiHTrIQ789kUXvjff/6aEAIjRdTojfG/Ijf164EnJSJQiNT6W1B7z/1sxT HJBaVnzrqIl6hVMoqYrYfOCJhMi+X0fUapWRrM1EqnmcYTEs30I4Bu7GnSFo5HYCYLfK 5r5MsMhVEJuHPA5pypwNs2yWRn+x1dALo8rz58Q85k0h96K2pVeoaOCKvwIh2znfx39d fcKNVnBPviwDtuPpkH1P9C+U1G91q9w8uxzVIhJlZioBU+Nm3a2h+kNWlsxuYqd7UzOP D0IpdaIuplw4xiCNEnEV0I3R8JGMcQjDW6nG9zVUwviiNj0Hs5SvRe/XPm3+P0tTqkea 6++g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=vZ8ERwscEtxe0iYeRb79ncVDZg6SUy4QAmcBo884SlU=; b=qgYjwUK/Rz/ZcIzj4QGj0FqsSWw7Cow62073w7r5SRA/BiqOuKZd9e8NBeFx93g7f/ YoFGYU5DF1RYi0iLAmsxQwegPBWL7gtC8ompgYps9EtwEiT24yTQ4HOXsnzUgonAEgCi FzS4pxv/9cQ4EFs0FXktxE2e4WG4VXoHF+NTmqeONOhJ2lFV15Bdx2abhZjLCcSQcloC NQrCoElH3562KHlj7tUKDV+VoX8a+scohoYpUxvBUvlGNnf99RN3G3iwHFGyBN2nokYw FF8yHCZIe2vO01pSjtYQZGCRs8+olATIim3Q+tP/3Jw1a0o4ElMEedKhj9epprbQBVD1 y3hg== X-Gm-Message-State: APjAAAVbEn9+88Bcy55c/4kYTCQRGRl6Wb9JohgCQGvzDJtdHEOLpvh2 JKN9j1yec4XbpkWB8Wx909Fs40Ze X-Google-Smtp-Source: APXvYqytpfeu2u4RNo9phR5QV8Gz/OHOic+opREmz8Dp6uTil3ZRbjyAgX1jYh+r8r2fajIezODI5g== X-Received: by 2002:a24:f587:: with SMTP id k129mr1128548ith.21.1558221734695; Sat, 18 May 2019 16:22:14 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id 1sm2370167ity.9.2019.05.18.16.22.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 May 2019 16:22:13 -0700 (PDT) In-Reply-To: <20190518231117.GA10282@zira.vinc17.org> (Vincent Lefevre's message of "Sun, 19 May 2019 01:11:17 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159516 Archived-At: --=-=-= Content-Type: text/plain Vincent Lefevre writes: > This patch makes 6 tests fail (when applied to the Debian package): > (void-variable beg) Dang it, I had thought I had fixed that before posting. Here's the correct version. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Keep-nxml-prolog-end-up-to-date-Bug-18871.patch Content-Description: patch >From b8c659dc0c6ef41adc19db3c1884f73c1a10c8d8 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 18 May 2019 14:54:36 -0400 Subject: [PATCH] Keep nxml-prolog-end up to date (Bug#18871) The change on 2016-01-16 "lisp/nxml: Use syntax-tables for comments" removed the update of nxml-prolog-end, although it already failed to work correctly after 2013-10-07 "* lisp/nxml/nxml-mode.el: Use lexical-binding and syntax-propertize." * lisp/nxml/nxml-rap.el: New function. * lisp/nxml/nxml-mode.el (nxml-mode): Add it to after-change-functions. --- lisp/nxml/nxml-mode.el | 1 + lisp/nxml/nxml-rap.el | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 7c39c5023c..b816bba819 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -534,6 +534,7 @@ nxml-mode (setq-local syntax-ppss-table sgml-tag-syntax-table) (setq-local syntax-propertize-function #'nxml-syntax-propertize) (add-hook 'change-major-mode-hook #'nxml-cleanup nil t) + (add-hook 'after-change-functions #'nxml-maybe-rescan-prolog nil t) ;; Emacs 23 handles the encoding attribute on the xml declaration ;; transparently to nxml-mode, so there is no longer a need for the below diff --git a/lisp/nxml/nxml-rap.el b/lisp/nxml/nxml-rap.el index 21dbaded25..3be413ae00 100644 --- a/lisp/nxml/nxml-rap.el +++ b/lisp/nxml/nxml-rap.el @@ -108,6 +108,12 @@ nxml-scan-prolog (setq nxml-prolog-regions (xmltok-forward-prolog)) (setq nxml-prolog-end (point)))) +(defun nxml-maybe-rescan-prolog (start _end _length) + "Reparse the prolog if START lies within it. +`nxml-mode' adds this function on `after-change-functions'." + (when (<= start nxml-prolog-end) + (save-excursion + (nxml-scan-prolog)))) ;;; Random access parsing -- 2.11.0 --=-=-=--