From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2018 10:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33887@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154590561529156 (code B ref -1); Thu, 27 Dec 2018 10:14:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Dec 2018 10:13:35 +0000 Received: from localhost ([127.0.0.1]:38194 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcSfW-0007aC-Ew for submit@debbugs.gnu.org; Thu, 27 Dec 2018 05:13:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcSfU-0007Zy-PG for submit@debbugs.gnu.org; Thu, 27 Dec 2018 05:13:33 -0500 Received: from lists.gnu.org ([208.118.235.17]:43018) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gcSfO-000851-Oe for submit@debbugs.gnu.org; Thu, 27 Dec 2018 05:13:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcSfN-0000HX-F6 for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 05:13:26 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcSfH-0007zL-Ee for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 05:13:23 -0500 Received: from joooj.vinc17.net ([2001:4b99:1:3:216:3eff:fe20:ac98]:43434) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gcSfF-0007lq-7a for bug-gnu-emacs@gnu.org; Thu, 27 Dec 2018 05:13:17 -0500 Received: from smtp-zira.vinc17.net (jlefevre.net1.nerim.net [80.65.226.245]) by joooj.vinc17.net (Postfix) with ESMTPSA id 20A8D2DD; Thu, 27 Dec 2018 11:13:08 +0100 (CET) Received: by zira.vinc17.org (Postfix, from userid 1000) id 804CAC218C3; Thu, 27 Dec 2018 11:13:06 +0100 (CET) From: Vincent Lefevre Date: Thu, 27 Dec 2018 11:13:06 +0100 Message-ID: <87ftujuvkd.fsf@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:4b99:1:3:216:3eff:fe20:ac98 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) When I open a large XML file and immediately go to the end of the file with ' >', Emacs hangs for several seconds. For instance, on /usr/share/xml/iso-codes/iso_639-3.xml from iso-codes in Debian (a 1-MB file), it takes 5 seconds. On a 4-MB personal XML file, it takes 15 seconds. This is a regression: Emacs 25 did not hang at all. In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.2) of 2018-12-26, modified by Debian built on x86-ubc-01 Windowing system distributor 'The X.Org Foundation', version 11.0.12003000 System Description: Debian GNU/Linux buster/sid Recent messages: Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...done Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...done Loading /etc/emacs/site-start.d/50maxima-emacs.el (source)...done Loading /etc/emacs/site-start.d/50psvn.el (source)...done Loading /etc/emacs/site-start.d/50python-docutils.el (source)...done Loading /etc/emacs/site-start.d/50texlive-lang-english.el (source)...done Loading /etc/emacs/site-start.d/50why3.el (source)...done Loading /home/vinc17/share/emacs/site-lisp/mutteditor.el (source)...done Loading time...done For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/26.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars 'CFLAGS=-g -O2 -fdebug-prefix-map=/build/emacs-3ThesY/emacs-26.1+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2 Important settings: value of $LC_COLLATE: POSIX value of $LC_CTYPE: en_US.UTF-8 value of $LC_TIME: en_DK value of $LANG: POSIX locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: display-time-mode: t show-paren-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-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 column-number-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: /usr/share/emacs/site-lisp/llvm-3.5/tablegen-mode hides /usr/share/emacs/site-lisp/llvm-3.6/tablegen-mode /usr/share/emacs/site-lisp/llvm-3.5/llvm-mode hides /usr/share/emacs/site-lisp/llvm-3.6/llvm-mode /usr/share/emacs/site-lisp/llvm-3.5/emacs hides /usr/share/emacs/site-lisp/llvm-3.6/emacs /usr/share/emacs/site-lisp/llvm-3.5/tablegen-mode hides /usr/share/emacs/site-lisp/llvm-3.7/tablegen-mode /usr/share/emacs/site-lisp/llvm-3.5/llvm-mode hides /usr/share/emacs/site-lisp/llvm-3.7/llvm-mode /usr/share/emacs/site-lisp/llvm-3.5/emacs hides /usr/share/emacs/site-lisp/llvm-3.7/emacs /usr/share/emacs/site-lisp/llvm-3.5/tablegen-mode hides /usr/share/emacs/site-lisp/llvm-3.8/tablegen-mode /usr/share/emacs/site-lisp/llvm-3.5/llvm-mode hides /usr/share/emacs/site-lisp/llvm-3.8/llvm-mode /usr/share/emacs/site-lisp/llvm-3.5/emacs hides /usr/share/emacs/site-lisp/llvm-3.8/emacs /usr/share/emacs/site-lisp/llvm-3.5/tablegen-mode hides /usr/share/emacs/site-lisp/llvm-3.9/tablegen-mode /usr/share/emacs/site-lisp/llvm-3.5/llvm-mode hides /usr/share/emacs/site-lisp/llvm-3.9/llvm-mode /usr/share/emacs/site-lisp/llvm-3.5/emacs hides /usr/share/emacs/site-lisp/llvm-3.9/emacs /usr/share/emacs/site-lisp/llvm-3.5/tablegen-mode hides /usr/share/emacs/site-lisp/llvm-4.0/tablegen-mode /usr/share/emacs/site-lisp/llvm-3.5/llvm-mode hides /usr/share/emacs/site-lisp/llvm-4.0/llvm-mode /usr/share/emacs/site-lisp/llvm-3.5/emacs hides /usr/share/emacs/site-lisp/llvm-4.0/emacs /usr/share/emacs/site-lisp/rst hides /usr/share/emacs/26.1/lisp/textmodes/rst /usr/share/emacs/site-lisp/latex-cjk-thai/thai-word hides /usr/share/emacs/26.1/lisp/language/thai-word Features: (shadow sort mail-extr warnings emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair time cus-start cus-load paren cc-styles cc-align cc-engine cc-vars cc-defs edmacro kmacro cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type 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 elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame 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 charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 118562 10618) (symbols 48 23199 1) (miscs 40 54 133) (strings 32 34944 2101) (string-bytes 1 946046) (vectors 16 15937) (vector-slots 8 510844 4784) (floats 8 56 97) (intervals 56 279 0) (buffers 992 12)) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2018 16:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre , Stefan Monnier Cc: 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.154592655115534 (code B ref 33887); Thu, 27 Dec 2018 16:03:01 +0000 Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 16:02:31 +0000 Received: from localhost ([127.0.0.1]:39468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcY79-00042O-Dn for submit@debbugs.gnu.org; Thu, 27 Dec 2018 11:02:31 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcY73-000425-1h for 33887@debbugs.gnu.org; Thu, 27 Dec 2018 11:02:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcY6s-00017u-2X for 33887@debbugs.gnu.org; Thu, 27 Dec 2018 11:02:15 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcY6r-00017o-Va; Thu, 27 Dec 2018 11:02:10 -0500 Received: from [176.228.60.248] (port=3563 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gcY6q-0003ML-7O; Thu, 27 Dec 2018 11:02:09 -0500 Date: Thu, 27 Dec 2018 18:02:07 +0200 Message-Id: <83imzf6jr4.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87ftujuvkd.fsf@zira.vinc17.org> (message from Vincent Lefevre on Thu, 27 Dec 2018 11:13:06 +0100) References: <87ftujuvkd.fsf@zira.vinc17.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Vincent Lefevre > Date: Thu, 27 Dec 2018 11:13:06 +0100 > > When I open a large XML file and immediately go to the end of the > file with ' >', Emacs hangs for several seconds. For instance, > on /usr/share/xml/iso-codes/iso_639-3.xml from iso-codes in Debian > (a 1-MB file), it takes 5 seconds. On a 4-MB personal XML file, it > takes 15 seconds. > > This is a regression: Emacs 25 did not hang at all. Confirmed, thanks. The profile (see below) blames syntax-ppss called by sgml-syntax-propertize, so I suspect commit 0055190, which added sgml-syntax-propertize-inside to sgml-syntax-propertize. CC'ing Stefan who made those changes. Here's the profile: - command-execute 532 77% - call-interactively 532 77% - funcall-interactively 522 75% - end-of-buffer 500 72% - recenter 496 71% - jit-lock-function 496 71% - jit-lock-fontify-now 496 71% - jit-lock--run-functions 496 71% - run-hook-wrapped 496 71% - # 496 71% - font-lock-fontify-region 496 71% - font-lock-default-fontify-region 496 71% - nxml-extend-region 496 71% - skip-syntax-forward 496 71% - internal--syntax-propertize 496 71% - syntax-propertize 496 71% - sgml-syntax-propertize 490 71% syntax-ppss 445 64% push-mark 1 0% - find-file 20 2% - find-file-noselect 20 2% - find-file-noselect-1 19 2% - after-find-file 17 2% - normal-mode 17 2% - set-auto-mode 17 2% - set-auto-mode-0 17 2% - xml-mode 17 2% - byte-code 14 2% - require 12 1% - byte-code 11 1% - require 10 1% - byte-code 9 1% - require 6 0% - byte-code 6 0% - cl-generic-define-method 4 0% - cl--generic-make-function 4 0% - cl--generic-make-next-function 4 0% - cl--generic-get-dispatcher 4 0% - byte-compile 3 0% byte-code 1 0% - # 1 0% byte-compile-top-level 1 0% - custom-declare-variable 1 0% - custom-initialize-reset 1 0% - eval 1 0% - funcall 1 0% - # 1 0% - executable-find 1 0% locate-file 1 0% file-truename 1 0% - rng-nxml-mode-init 2 0% - rng-validate-mode 2 0% - rng-auto-set-schema 2 0% - rng-locate-schema-file 2 0% - rng-locate-schema-file-using 2 0% - rng-get-parsed-schema-locating-file 2 0% - rng-parse-schema-locating-file 1 0% - rng-parse-validate-file 1 0% - nxml-parse-instance 1 0% nxml-parse-instance-1 1 0% - file-truename 1 0% - file-truename 1 0% - file-truename 1 0% file-truename 1 0% - insert-file-contents 1 0% xml-find-file-coding-system 1 0% - execute-extended-command 1 0% - sit-for 1 0% redisplay 1 0% - minibuffer-complete 1 0% - completion-in-region 1 0% - completion--in-region 1 0% - # 1 0% - apply 1 0% - # 1 0% - completion--in-region-1 1 0% - completion--do-completion 1 0% - completion-try-completion 1 0% - completion--nth-completion 1 0% - completion--some 1 0% - # 1 0% - completion-basic-try-completion 1 0% - try-completion 1 0% completion-file-name-table 1 0% - byte-code 10 1% - read-extended-command 9 1% - completing-read 9 1% - completing-read-default 9 1% read-from-minibuffer 9 1% - find-file-read-args 1 0% - read-file-name 1 0% - read-file-name-default 1 0% - completing-read 1 0% - completing-read-default 1 0% - read-from-minibuffer 1 0% - redisplay_internal (C function) 1 0% find-image 1 0% - ... 158 22% Automatic GC 156 22% - macroexp--all-forms 1 0% - macroexp--expand-all 1 0% - # 1 0% - macroexp--all-forms 1 0% - macroexp--expand-all 1 0% - macroexp--all-forms 1 0% - macroexp--expand-all 1 0% - # 1 0% - macroexp--all-forms 1 0% - macroexp--expand-all 1 0% - # 1 0% - macroexp--all-forms 1 0% - macroexp--expand-all 1 0% - macroexp-macroexpand 1 0% - macroexpand 1 0% # 1 0% - rng-compute-start-tag-open-deriv 1 0% - rng-element-get-child 1 0% - rng-compile 1 0% - apply 1 0% - rng-compile-group 1 0% - mapcar 1 0% - rng-compile 1 0% - apply 1 0% - rng-compile-attribute 1 0% - rng-compile 1 0% - apply 1 0% - rng-compile-ref 1 0% - rng-compile 1 0% - apply 1 0% - rng-compile-data 1 0% rng-compile-dt 1 0% From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2018 16:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Vincent Lefevre , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.154592875218869 (code B ref 33887); Thu, 27 Dec 2018 16:40:02 +0000 Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 16:39:12 +0000 Received: from localhost ([127.0.0.1]:39480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcYgh-0004uG-Ma for submit@debbugs.gnu.org; Thu, 27 Dec 2018 11:39:12 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:51334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcYge-0004u8-S8 for 33887@debbugs.gnu.org; Thu, 27 Dec 2018 11:39:09 -0500 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wBRGd6Kg001933; Thu, 27 Dec 2018 11:39:07 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 6EFB4AE0D0; Thu, 27 Dec 2018 11:39:06 -0500 (EST) From: Stefan Monnier Message-ID: References: <87ftujuvkd.fsf@zira.vinc17.org> <83imzf6jr4.fsf@gnu.org> Date: Thu, 27 Dec 2018 11:39:06 -0500 In-Reply-To: <83imzf6jr4.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Dec 2018 18:02:07 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6448=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6448> : inlines <6990> : streams <1808356> : uri <2770859> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> When I open a large XML file and immediately go to the end of the >> file with ' >', Emacs hangs for several seconds. For instance, >> on /usr/share/xml/iso-codes/iso_639-3.xml from iso-codes in Debian >> (a 1-MB file), it takes 5 seconds. On a 4-MB personal XML file, it >> takes 15 seconds. >> >> This is a regression: Emacs 25 did not hang at all. > > Confirmed, thanks. > > The profile (see below) blames syntax-ppss called by > sgml-syntax-propertize, so I suspect commit 0055190, which added > sgml-syntax-propertize-inside to sgml-syntax-propertize. Sounds right, but I'm not sure what to do about this. I don't wonder why so much time is passed on syntax-ppss, which is generally expected to be relatively fast. Maybe sgml-syntax-propertize is called too often (I see it's mostly called from skip-syntax-forward; maybe we should call syntax-propertize explicitly beforehand with a more distant position so sgml-syntax-propertize is called just once). Stefan > Here's the profile: > > - command-execute 532 77% > - call-interactively 532 77% > - funcall-interactively 522 75% > - end-of-buffer 500 72% > - recenter 496 71% > - jit-lock-function 496 71% > - jit-lock-fontify-now 496 71% > - jit-lock--run-functions 496 71% > - run-hook-wrapped 496 71% > - # 496 71% > - font-lock-fontify-region 496 71% > - font-lock-default-fontify-region 496 71% > - nxml-extend-region 496 71% > - skip-syntax-forward 496 71% > - internal--syntax-propertize 496 71% > - syntax-propertize 496 71% > - sgml-syntax-propertize 490 71% > syntax-ppss 445 64% > push-mark 1 0% > - find-file 20 2% > - find-file-noselect 20 2% > - find-file-noselect-1 19 2% > - after-find-file 17 2% > - normal-mode 17 2% > - set-auto-mode 17 2% > - set-auto-mode-0 17 2% > - xml-mode 17 2% > - byte-code 14 2% > - require 12 1% > - byte-code 11 1% > - require 10 1% > - byte-code 9 1% > - require 6 0% > - byte-code 6 0% > - cl-generic-define-method 4 0% > - cl--generic-make-function 4 0% > - cl--generic-make-next-function 4 0% > - cl--generic-get-dispatcher 4 0% > - byte-compile 3 0% > byte-code 1 0% > - # 1 0% > byte-compile-top-level 1 0% > - custom-declare-variable 1 0% > - custom-initialize-reset 1 0% > - eval 1 0% > - funcall 1 0% > - # 1 0% > - executable-find 1 0% > locate-file 1 0% > file-truename 1 0% > - rng-nxml-mode-init 2 0% > - rng-validate-mode 2 0% > - rng-auto-set-schema 2 0% > - rng-locate-schema-file 2 0% > - rng-locate-schema-file-using 2 0% > - rng-get-parsed-schema-locating-file 2 0% > - rng-parse-schema-locating-file 1 0% > - rng-parse-validate-file 1 0% > - nxml-parse-instance 1 0% > nxml-parse-instance-1 1 0% > - file-truename 1 0% > - file-truename 1 0% > - file-truename 1 0% > file-truename 1 0% > - insert-file-contents 1 0% > xml-find-file-coding-system 1 0% > - execute-extended-command 1 0% > - sit-for 1 0% > redisplay 1 0% > - minibuffer-complete 1 0% > - completion-in-region 1 0% > - completion--in-region 1 0% > - # 1 0% > - apply 1 0% > - # 1 0% > - completion--in-region-1 1 0% > - completion--do-completion 1 0% > - completion-try-completion 1 0% > - completion--nth-completion 1 0% > - completion--some 1 0% > - # 1 0% > - completion-basic-try-completion 1 0% > - try-completion 1 0% > completion-file-name-table 1 0% > - byte-code 10 1% > - read-extended-command 9 1% > - completing-read 9 1% > - completing-read-default 9 1% > read-from-minibuffer 9 1% > - find-file-read-args 1 0% > - read-file-name 1 0% > - read-file-name-default 1 0% > - completing-read 1 0% > - completing-read-default 1 0% > - read-from-minibuffer 1 0% > - redisplay_internal (C function) 1 0% > find-image 1 0% > - ... 158 22% > Automatic GC 156 22% > - macroexp--all-forms 1 0% > - macroexp--expand-all 1 0% > - # 1 0% > - macroexp--all-forms 1 0% > - macroexp--expand-all 1 0% > - macroexp--all-forms 1 0% > - macroexp--expand-all 1 0% > - # 1 0% > - macroexp--all-forms 1 0% > - macroexp--expand-all 1 0% > - # 1 0% > - macroexp--all-forms 1 0% > - macroexp--expand-all 1 0% > - macroexp-macroexpand 1 0% > - macroexpand 1 0% > # 1 0% > - rng-compute-start-tag-open-deriv 1 0% > - rng-element-get-child 1 0% > - rng-compile 1 0% > - apply 1 0% > - rng-compile-group 1 0% > - mapcar 1 0% > - rng-compile 1 0% > - apply 1 0% > - rng-compile-attribute 1 0% > - rng-compile 1 0% > - apply 1 0% > - rng-compile-ref 1 0% > - rng-compile 1 0% > - apply 1 0% > - rng-compile-data 1 0% > rng-compile-dt 1 0% From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2018 16:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: vincent@vinc17.net, 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.154592900619263 (code B ref 33887); Thu, 27 Dec 2018 16:44:02 +0000 Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 16:43:26 +0000 Received: from localhost ([127.0.0.1]:39487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcYkn-00050d-MU for submit@debbugs.gnu.org; Thu, 27 Dec 2018 11:43:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcYkm-00050Q-UQ for 33887@debbugs.gnu.org; Thu, 27 Dec 2018 11:43:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcYke-0001ng-67 for 33887@debbugs.gnu.org; Thu, 27 Dec 2018 11:43:19 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcYkc-0001nS-Va; Thu, 27 Dec 2018 11:43:15 -0500 Received: from [176.228.60.248] (port=2118 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gcYkc-0005B8-J3; Thu, 27 Dec 2018 11:43:14 -0500 Date: Thu, 27 Dec 2018 18:43:14 +0200 Message-Id: <83ftui7wf1.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Stefan Monnier on Thu, 27 Dec 2018 11:39:06 -0500) References: <87ftujuvkd.fsf@zira.vinc17.org> <83imzf6jr4.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Stefan Monnier > Cc: Vincent Lefevre , 33887@debbugs.gnu.org > Date: Thu, 27 Dec 2018 11:39:06 -0500 > > > The profile (see below) blames syntax-ppss called by > > sgml-syntax-propertize, so I suspect commit 0055190, which added > > sgml-syntax-propertize-inside to sgml-syntax-propertize. > > Sounds right, but I'm not sure what to do about this. > I don't wonder why so much time is passed on syntax-ppss, which is > generally expected to be relatively fast. Why was sgml-syntax-propertize-inside added? Is its effect an absolute must, or merely a nice-to-have feature? If the latter, perhaps a defcustom that could disable that call will be an okay solution, at least as a stopgap? From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2018 17:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: vincent@vinc17.net, 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.154593194524210 (code B ref 33887); Thu, 27 Dec 2018 17:33:02 +0000 Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 17:32:25 +0000 Received: from localhost ([127.0.0.1]:39513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcZWD-0006IQ-EH for submit@debbugs.gnu.org; Thu, 27 Dec 2018 12:32:25 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:52802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcZWB-0006IF-2m for 33887@debbugs.gnu.org; Thu, 27 Dec 2018 12:32:23 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wBRHWMaO007291; Thu, 27 Dec 2018 12:32:22 -0500 Received: by pastel.home (Postfix, from userid 20848) id D7F3B6A505; Thu, 27 Dec 2018 12:32:21 -0500 (EST) From: Stefan Monnier Message-ID: References: <87ftujuvkd.fsf@zira.vinc17.org> <83imzf6jr4.fsf@gnu.org> <83ftui7wf1.fsf@gnu.org> Date: Thu, 27 Dec 2018 12:32:21 -0500 In-Reply-To: <83ftui7wf1.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Dec 2018 18:43:14 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6448=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6448> : inlines <6990> : streams <1808359> : uri <2770879> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Why was sgml-syntax-propertize-inside added? Is its effect an > absolute must, or merely a nice-to-have feature? It's needed for correctness in the presence of or > If the latter, perhaps a defcustom that could disable that call will > be an okay solution, at least as a stopgap? I don't think it should be terribly expensive, so I'd rather first try and better understand the performance issue, Stefan From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2018 17:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: vincent@vinc17.net, 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.154593286125691 (code B ref 33887); Thu, 27 Dec 2018 17:48:01 +0000 Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 17:47:41 +0000 Received: from localhost ([127.0.0.1]:39521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcZkz-0006gJ-Iv for submit@debbugs.gnu.org; Thu, 27 Dec 2018 12:47:41 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcZky-0006g3-8w for 33887@debbugs.gnu.org; Thu, 27 Dec 2018 12:47:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcZko-0006n2-RS for 33887@debbugs.gnu.org; Thu, 27 Dec 2018 12:47:34 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcZko-0006mq-OC; Thu, 27 Dec 2018 12:47:30 -0500 Received: from [176.228.60.248] (port=2307 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gcZko-0002Bg-Br; Thu, 27 Dec 2018 12:47:30 -0500 Date: Thu, 27 Dec 2018 19:47:29 +0200 Message-Id: <83bm567tfy.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Stefan Monnier on Thu, 27 Dec 2018 12:32:21 -0500) References: <87ftujuvkd.fsf@zira.vinc17.org> <83imzf6jr4.fsf@gnu.org> <83ftui7wf1.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Stefan Monnier > Cc: vincent@vinc17.net, 33887@debbugs.gnu.org > Date: Thu, 27 Dec 2018 12:32:21 -0500 > > > If the latter, perhaps a defcustom that could disable that call will > > be an okay solution, at least as a stopgap? > > I don't think it should be terribly expensive, so I'd rather first try > and better understand the performance issue, Sure. I thought you already did ;-) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Dec 2018 18:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Eli Zaretskii , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.154593619330861 (code B ref 33887); Thu, 27 Dec 2018 18:44:01 +0000 Received: (at 33887) by debbugs.gnu.org; 27 Dec 2018 18:43:13 +0000 Received: from localhost ([127.0.0.1]:39538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcacf-00081c-B2 for submit@debbugs.gnu.org; Thu, 27 Dec 2018 13:43:13 -0500 Received: from joooj.vinc17.net ([155.133.131.76]:40490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcaca-00081R-5X for 33887@debbugs.gnu.org; Thu, 27 Dec 2018 13:43:08 -0500 Received: from smtp-zira.vinc17.net (jlefevre.net1.nerim.net [80.65.226.245]) by joooj.vinc17.net (Postfix) with ESMTPSA id D457A2DD; Thu, 27 Dec 2018 19:43:02 +0100 (CET) Received: by zira.vinc17.org (Postfix, from userid 1000) id 102E1C207A9; Thu, 27 Dec 2018 19:43:02 +0100 (CET) Date: Thu, 27 Dec 2018 19:43:02 +0100 From: Vincent Lefevre Message-ID: <20181227184302.GG2581@zira.vinc17.org> References: <87ftujuvkd.fsf@zira.vinc17.org> <83imzf6jr4.fsf@gnu.org> <83ftui7wf1.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.1+41 (02252dac) vl-114013 (2018-12-13) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2018-12-27 12:32:21 -0500, Stefan Monnier wrote: > > Why was sgml-syntax-propertize-inside added? Is its effect an > > absolute must, or merely a nice-to-have feature? > > It's needed for correctness in the presence of or I use both in some of my XML files and I have never found any issue with them. Or perhaps this is just for particular cases? -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Dec 2018 17:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: Eli Zaretskii , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.154601753620933 (code B ref 33887); Fri, 28 Dec 2018 17:19:02 +0000 Received: (at 33887) by debbugs.gnu.org; 28 Dec 2018 17:18:56 +0000 Received: from localhost ([127.0.0.1]:40634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcvmi-0005RZ-1k for submit@debbugs.gnu.org; Fri, 28 Dec 2018 12:18:56 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:56250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gcvmf-0005RQ-H4 for 33887@debbugs.gnu.org; Fri, 28 Dec 2018 12:18:54 -0500 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id wBSHIpDW015853; Fri, 28 Dec 2018 12:18:52 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 36287AE0D0; Fri, 28 Dec 2018 12:18:51 -0500 (EST) From: Stefan Monnier Message-ID: References: <87ftujuvkd.fsf@zira.vinc17.org> <83imzf6jr4.fsf@gnu.org> <83ftui7wf1.fsf@gnu.org> <20181227184302.GG2581@zira.vinc17.org> Date: Fri, 28 Dec 2018 12:18:51 -0500 In-Reply-To: <20181227184302.GG2581@zira.vinc17.org> (Vincent Lefevre's message of "Thu, 27 Dec 2018 19:43:02 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6449=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6449> : inlines <6990> : streams <1808454> : uri <2771360> X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> > Why was sgml-syntax-propertize-inside added? Is its effect an >> > absolute must, or merely a nice-to-have feature? >> It's needed for correctness in the presence of or > I use both in some of my XML files and I have never found any issue > with them. Or perhaps this is just for particular cases? Yes, it only makes a real difference when the content of those things ends up confusing the parser (e.g. it looks like an unclosed tag, or things along these lines). Stefan From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode References: <87ftujuvkd.fsf@zira.vinc17.org> In-Reply-To: <87ftujuvkd.fsf@zira.vinc17.org> Resent-From: Fernando Jascovich Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 08 Jan 2019 22:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 33887@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154698573717451 (code B ref -1); Tue, 08 Jan 2019 22:16:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jan 2019 22:15:37 +0000 Received: from localhost ([127.0.0.1]:50612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggzeq-0004XO-SB for submit@debbugs.gnu.org; Tue, 08 Jan 2019 17:15:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggzae-0004PM-61 for submit@debbugs.gnu.org; Tue, 08 Jan 2019 17:11:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:56974) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ggzaY-00043t-Vr for submit@debbugs.gnu.org; Tue, 08 Jan 2019 17:11:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggzaY-0006r9-5w for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 17:11:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggzaX-00042v-Ex for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 17:11:10 -0500 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:43244) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggzaX-000409-B8 for bug-gnu-emacs@gnu.org; Tue, 08 Jan 2019 17:11:09 -0500 Received: by mail-qt1-x842.google.com with SMTP id i7so6209407qtj.10 for ; Tue, 08 Jan 2019 14:11:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:user-agent:mime-version; bh=/HDcdd8CfBa0p1CHQgBR72dP2zxUA/imeA8yeDRFLmo=; b=N4oW44fWiSWqnXS8fjXw64fuz7ic6QnMN5ZJNYArBZ6fmkRWm6yOcsBsUE/GJbEXYs znV7E0+Pf2F5iqyaG/nFrR5aX7VLgZ2Np6jlsBTqUvnwGt6oJQsUrLEzxVQRyTedQXsj moJ69sHBrQQrJJeM6hNJvpJAqREBpXKvZQrontDMGQ4ORGH2f2i4fGgcN9tDtj2Objk8 fTuV73rPp4vshxkxKNxtwfk5d7Z6Gnj1yATZMMVv4jJ9tIV4YUZ83nNJeckiTkm1O5Hb lhCgHHswcaMXQShO7julkQyX0Wp12iIlKAEwd9WdNhcmzxlnArP4h0+B31Z73yieWNSQ nTvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=/HDcdd8CfBa0p1CHQgBR72dP2zxUA/imeA8yeDRFLmo=; b=hXSa4geMz+ccWf6EYZ8Vov735o3NjV2ROlw+fFGAfTbjewTI4OM4dyBg7B9fQ28o3A YoxCF4xxJBGy5eoF9T4noXC//r+md7sOXmoLwpIQVnLHYtaBiGzeHVIHyRa81gYfaU7G inzJnBQhYwiLCLgxd0zMnciqkV2xuqThy+PXegCsM7qVYR3s/BloxJnCPihPDQoHDW9t WRMNnrCy6htruj0lfgN3XUQWccHCWYYeQXxWuvbt3QKpB2EHwEDN7eQB/+kG5lfs9LdT 5OV3f6iAHzcu8a79rDFyCllQ6fORJy7KHOuP5KCwiPsPt608OjaZJp6fqYk87+9Cz5sA oV4w== X-Gm-Message-State: AJcUukdoQRWNcKJ+jpYgD+0dV49h11gkl2/sF8vOZxSFGWiuxiVoVHqw 9h/HO25RTU8cLujLY836CnJklEW2jjc= X-Google-Smtp-Source: ALg8bN4wyRcXxQYE12Q0eIxPUmikKe8UbtPV5dOXNtkIhU5PiHBN8DkNJvEbNfsc/S40DRZbL1rZog== X-Received: by 2002:ac8:7353:: with SMTP id q19mr3316686qtp.265.1546985467742; Tue, 08 Jan 2019 14:11:07 -0800 (PST) Received: from pop-os ([168.232.248.7]) by smtp.gmail.com with ESMTPSA id a17sm33321049qth.93.2019.01.08.14.11.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 14:11:07 -0800 (PST) From: Fernando Jascovich Date: Tue, 08 Jan 2019 19:11:02 -0300 Message-ID: <87ef9m2421.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::842 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Mailman-Approved-At: Tue, 08 Jan 2019 17:15:35 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi everyone, this is my first email to bug-gnu-emacs, so please let me know if I am making some mistake. For no special reason, I took this bug in order to start to know emacs' code. Following and confirming the details of the bug, I found that indeed the performance issue is introduced at commit 0055190174, but not beacuse the introduction of `sgml-syntax-propertize-inside`. The problem is with the last rule: ``` ("\"" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) (goto-char (match-end 0))) (string-to-syntax "."))) ``` I can't see the real effect of this rule, I tested xml parsing without this rule and it works fine, marking double quotes inside tags as expected without this performance issue. Do we need to target double quotes outside tags explicitly? -- Fernando Jascovich developer m: +54 9 3548 63 9833 github: https://github.com/fernando-jascovich/ linkedin: https://www.linkedin.com/in/fernandojascovich/ From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Jan 2019 15:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Fernando Jascovich , Stefan Monnier Cc: 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.154713299422087 (code B ref 33887); Thu, 10 Jan 2019 15:10:01 +0000 Received: (at 33887) by debbugs.gnu.org; 10 Jan 2019 15:09:54 +0000 Received: from localhost ([127.0.0.1]:54085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghbxx-0005kB-Pb for submit@debbugs.gnu.org; Thu, 10 Jan 2019 10:09:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghbxw-0005jz-0C for 33887@debbugs.gnu.org; Thu, 10 Jan 2019 10:09:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghbxq-0002gv-99 for 33887@debbugs.gnu.org; Thu, 10 Jan 2019 10:09:46 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghbxq-0002gf-59; Thu, 10 Jan 2019 10:09:46 -0500 Received: from [176.228.60.248] (port=3280 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ghbxp-0006ML-OK; Thu, 10 Jan 2019 10:09:46 -0500 Date: Thu, 10 Jan 2019 17:09:39 +0200 Message-Id: <8336q0im6k.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87ef9m2421.fsf@gmail.com> (message from Fernando Jascovich on Tue, 08 Jan 2019 19:11:02 -0300) References: <87ftujuvkd.fsf@zira.vinc17.org> <87ef9m2421.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:470:142:3::e X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > From: Fernando Jascovich > Date: Tue, 08 Jan 2019 19:11:02 -0300 > > Hi everyone, this is my first email to bug-gnu-emacs, so please let me > know if I am making some mistake. > For no special reason, I took this bug in order to start to know emacs' > code. > Following and confirming the details of the bug, I found that indeed the > performance issue is introduced at commit 0055190174, but not beacuse > the introduction of `sgml-syntax-propertize-inside`. > The problem is with the last rule: > ``` > ("\"" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) > (goto-char (match-end 0))) > (string-to-syntax "."))) > ``` > I can't see the real effect of this rule, I tested xml parsing without > this rule and it works fine, marking double quotes inside tags as > expected without this performance issue. > Do we need to target double quotes outside tags explicitly? Stefan, any comments? From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Jan 2019 22:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Vincent Lefevre , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.154776583613877 (code B ref 33887); Thu, 17 Jan 2019 22:58:02 +0000 Received: (at 33887) by debbugs.gnu.org; 17 Jan 2019 22:57:16 +0000 Received: from localhost ([127.0.0.1]:35418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkGb6-0003bl-Fc for submit@debbugs.gnu.org; Thu, 17 Jan 2019 17:57:16 -0500 Received: from alt22.smtp-out.videotron.ca ([70.80.0.73]:11282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkGb3-0003bX-UN for 33887@debbugs.gnu.org; Thu, 17 Jan 2019 17:57:14 -0500 Received: from fmsmemgm.homelinux.net ([23.233.195.134]) by Videotron with SMTP id kGaxggY8I6r0CkGaygJOHf; Thu, 17 Jan 2019 17:57:08 -0500 X-Authority-Analysis: v=2.3 cv=D61p1MZj c=1 sm=1 tr=0 a=xXJ578j8WyTliCxld3/pTA==:117 a=xXJ578j8WyTliCxld3/pTA==:17 a=3JhidrIBZZsA:10 a=nhY0VSo43tPj97HzVlUA:9 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 21A13AE0EE; Thu, 17 Jan 2019 17:57:07 -0500 (EST) From: Stefan Monnier Message-ID: References: <87ftujuvkd.fsf@zira.vinc17.org> <83imzf6jr4.fsf@gnu.org> Date: Thu, 17 Jan 2019 17:57:07 -0500 In-Reply-To: <83imzf6jr4.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Dec 2018 18:02:07 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-CMAE-Envelope: MS4wfAEL8NOTrszVtErXxGqYdEjvkuVPdEPSHU6Pvnl4IvhMIpWUyNH1SZD2hL8pZbrRMpqClQoZ7f3hpXkEWFWhA0AZpRnZOKp+922Akdtwjie2MUhUYRYm 7orKQ6TQP8yS7W8ubSzG2xUh0jy/0ivr6Mh6WGMYlxQkAWOjI+BPrjtqFzZfL3ozvWS3GbioAxeQZabSDBdP2l8eBDdSMukaqMh5/OCu9bahBDSR4G8Kt9zr FSDjY/YypVLGOo25YnLrhm4oT+WhWiuqVXOb39Ps8UdxeWi2ffZr7ZukuODfp4zY X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > The profile (see below) blames syntax-ppss called by > sgml-syntax-propertize, so I suspect commit 0055190, which added > sgml-syntax-propertize-inside to sgml-syntax-propertize. Hmm... actually, the syntax-ppss calls that take time are directly made from within sgml-syntax-propertize rather than from within sgml-syntax-propertize-inside (which doesn't even appear in your profile (in my profile I get 8099 units of time in sgml-syntax-propertize, of which 7611 in syntax-ppss and only 77 in sgml-syntax-propertize-inside). The problem seems to come from the following syntax propertize rule: ;; Double quotes outside of tags should not introduce strings. ;; Be careful to call `syntax-ppss' on a position before the one we're ;; going to change, so as not to need to flush the data we just computed. ("\"" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) (goto-char (match-end 0))) (string-to-syntax ".")))) If I comment it out, the delay is *much* smaller. The problem being that " are quite common characters in XML files, so the regexp matches often and we call syntax-ppss each time, so we end up calling syntax-ppss very often. I'm trying to figure out how to avoid calling syntax-ppss for every " character. I'm thinking of looking at pairs of " chars and only do extra work if there's a < or > between the two. Stefan From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Jan 2019 23:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Fernando Jascovich , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.154776756616427 (code B ref 33887); Thu, 17 Jan 2019 23:27:02 +0000 Received: (at 33887) by debbugs.gnu.org; 17 Jan 2019 23:26:06 +0000 Received: from localhost ([127.0.0.1]:35425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkH2z-0004Gt-Rk for submit@debbugs.gnu.org; Thu, 17 Jan 2019 18:26:06 -0500 Received: from alt42.smtp-out.videotron.ca ([23.233.128.29]:28812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkH2w-0004GN-MH for 33887@debbugs.gnu.org; Thu, 17 Jan 2019 18:26:04 -0500 Received: from fmsmemgm.homelinux.net ([23.233.195.134]) by Videotron with SMTP id kH2pg9NQgFsgZkH2qgMywn; Thu, 17 Jan 2019 18:25:57 -0500 X-Authority-Analysis: v=2.3 cv=Y7LWTCWN c=1 sm=1 tr=0 a=xXJ578j8WyTliCxld3/pTA==:117 a=xXJ578j8WyTliCxld3/pTA==:17 a=3JhidrIBZZsA:10 a=pGLkceISAAAA:8 a=RELml-1EI8_4TFrIe0YA:9 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 1A982AE0EE; Thu, 17 Jan 2019 18:25:55 -0500 (EST) From: Stefan Monnier Message-ID: References: <87ftujuvkd.fsf@zira.vinc17.org> <87ef9m2421.fsf@gmail.com> <8336q0im6k.fsf@gnu.org> Date: Thu, 17 Jan 2019 18:25:55 -0500 In-Reply-To: <8336q0im6k.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 10 Jan 2019 17:09:39 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-CMAE-Envelope: MS4wfAbs3K9Z3CF8NojyOkrqiEZ7fRvheJbKXvlVqoDDkAnmxZ3yKAqUmuni5IleLtb2vBCme+m4xbv6q+KLja1SkPsv80LtKPmlIhuapL6EV5TFbHSKTIUi fFXrgxsbn4Hg8VK3NHQHEDTl5AzoFJXCSitlHW4pHyc8AAAGRXv/m7kUuhtyITAfGbDKY4i/detgo8tp4Nirg+7riTUNbyDw73LQXvj8FpZd4DUIlqN0zbeZ FIaCja45wc40i+xWIY4QvkI4Uy/OaxrmWWGYGqulz5LaZvPMalG/PvfUwlcY7eT/ X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) >> From: Fernando Jascovich >> Date: Tue, 08 Jan 2019 19:11:02 -0300 >> >> Hi everyone, this is my first email to bug-gnu-emacs, so please let me >> know if I am making some mistake. >> For no special reason, I took this bug in order to start to know emacs' >> code. >> Following and confirming the details of the bug, I found that indeed the >> performance issue is introduced at commit 0055190174, but not beacuse >> the introduction of `sgml-syntax-propertize-inside`. >> The problem is with the last rule: >> ``` >> ("\"" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) >> (goto-char (match-end 0))) >> (string-to-syntax "."))) >> ``` >> I can't see the real effect of this rule, I tested xml parsing without >> this rule and it works fine, marking double quotes inside tags as >> expected without this performance issue. >> Do we need to target double quotes outside tags explicitly? > > Stefan, any comments? Yes, he's exactly right. I just pushed a patch to master which should reduce significantly this delay. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 17 19:50:43 2019 Received: (at control) by debbugs.gnu.org; 17 Apr 2019 23:50:43 +0000 Received: from localhost ([127.0.0.1]:41039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hGuKB-00023p-4D for submit@debbugs.gnu.org; Wed, 17 Apr 2019 19:50:43 -0400 Received: from mail-qt1-f180.google.com ([209.85.160.180]:35761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hGuK9-00023X-4w; Wed, 17 Apr 2019 19:50:41 -0400 Received: by mail-qt1-f180.google.com with SMTP id h39so339523qte.2; Wed, 17 Apr 2019 16:50:41 -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=a9nzTRl1TODbmWUx5ywgDk1ezi71ewGjpmATJ1Pv3bs=; b=pd5rk/52cV1LNW7eRR+tsd8Dm+Hj+PIRE5qR+AAKPK6MyGuUIB61mSvdxw2ZofoQYw fFvzJNPKsbS9yTV7jgtFoKjBMmOY1HFeNpSsg8zY4A8Lldfv0hyF3AkZYSwCSO/gzJM2 cUSkwfp/0rihLvIMMAPc94/3+dMEsnXWrErJvvbHI9ekgTEBaoZF37gq3DVbJ62pSlUm YeyYkvHkzuHS/T7fkKwSY8ItknnkpfZFMIy5UTUWmZ1YtE7a3bae7SVYAr/MOfELzTeU gCCDbfTaw/mDV5wREvyPvUT9j+NQ7PEGP2cJVKYfVFV58hUZKW+d5xE6dXeseTGV69/t 89lQ== 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=a9nzTRl1TODbmWUx5ywgDk1ezi71ewGjpmATJ1Pv3bs=; b=JhRB6b4DASSgiKCaMgLvlUoQcmXTvBbRgaiGVI1m0dTgOxO7vzCYO8FNYq4bCf9kBN pA1CM6XIh60jp10FW5vDNTiMRUnFyZWadd5NxeDoUoY2mkHrM7MUams6nz6MnM0ShOGv FCo8WeqPjtWmASOGrGrRisoTfJCJnZVIjpsm4pU6wKKIKEMDN5Z+ZGq1cPIIIzJKsXqg oHQJ1I8Dq8nvrhcGKd/MT1EySm0sOrDHHN82zg3d9NLQGUriUdv2xjzxuSq8LDJJGWoG cdM8OYlw6G25v+FoNq4YWxpngd8cEZNodHbhDrPiVR6Rqe+38ZdTUsPi0TAwv+QNxvmZ r35A== X-Gm-Message-State: APjAAAWFwxrlkW2mmQb5mzech7waetsO8pnFkNAXtcVQBHZURmQVSx9y Kz4FaBqkk6pHoG9B/8FXUrtMiumf X-Google-Smtp-Source: APXvYqz8hYLJNUH82PHSyCHfCCeC7bci7qTOQkgAQ5iUV85R1Kze8is7iqLm+rSsu6srqfm9IPOSeA== X-Received: by 2002:a0c:8af7:: with SMTP id 52mr73860255qvw.169.1555545035510; Wed, 17 Apr 2019 16:50:35 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id 27sm309009qtp.49.2019.04.17.16.50.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Apr 2019 16:50:34 -0700 (PDT) From: Noam Postavsky To: Kevin Brubeck Unhammer Subject: Re: bug#25176: 26.0.50; nxml-mode hangs on first failing isearch after opening big file References: <87zik2t9we.fsf@fsfe.org> Date: Wed, 17 Apr 2019 19:50:34 -0400 In-Reply-To: <87zik2t9we.fsf@fsfe.org> (Kevin Brubeck Unhammer's message of "Sun, 11 Dec 2016 22:48:17 +0100") Message-ID: <87imvcw5rp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: 25176@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) merge 25176 33887 quit Kevin Brubeck Unhammer writes: > To reproduce: > > $ wget https://unhammer.org/k/nxml-isearch-hang.xml > $ emacs -Q nxml-isearch-hang.xml > # Then in emacs, answer yes and isearch for e.g. "x-x": > y C-s x - x > > Now it'll hang, and require a C-g. A subsequent search, however, is > instant. The file is now 404, but I this sounds the same as Bug#33887 "26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode". From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 May 2019 23:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155796440022831 (code B ref 33887); Wed, 15 May 2019 23:54:01 +0000 Received: (at 33887) by debbugs.gnu.org; 15 May 2019 23:53:20 +0000 Received: from localhost ([127.0.0.1]:53678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hR3i3-0005wB-PR for submit@debbugs.gnu.org; Wed, 15 May 2019 19:53:19 -0400 Received: from mail-io1-f47.google.com ([209.85.166.47]:41843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hR3i1-0005vx-Pg for 33887@debbugs.gnu.org; Wed, 15 May 2019 19:53:19 -0400 Received: by mail-io1-f47.google.com with SMTP id a17so1066243iot.8 for <33887@debbugs.gnu.org>; Wed, 15 May 2019 16:53:17 -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=klZ3Ge3O11d5tCNunI5VhgshuxVSb5boUs2xJQf6W50=; b=gAFnC03pJlTraFyG2dPThOfTvCpAc0jzu/XdtE4sOn8S+1JonFU3PePY/Ad46oOAXQ P9WMBb0JzQ8VJ1L/rATIAL9mEsLayZryNYEtT9LhD7brMMvEpQPHHn478JhnkRGJxrUo XT66BrxHbd6gyV5IF3avSBEX9TmWJ0k4dUkdV8a+Axz1819emsASM83j79p4yzrXh/4L +bGNntTe/Vt2LLqWyu0tC9ED/I44YKqwiiq5gzAXwmnd5o0KwR5D4Z4GGb4lARSTlTqd VVdrBURVRSdKiMsHerdbP9km/FseMVrVc7aD+9kNRdCcnVZZRBsQBybbkvzq9FxXZz+H ucfg== 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=klZ3Ge3O11d5tCNunI5VhgshuxVSb5boUs2xJQf6W50=; b=XK/zZlWpcniCwGPmWNdREzJOuc+voV1pa/9lVHNOZIIy49MaCPQHzwCAw4P9VH7mkf /7A5kEuSGHt8/TuAAxZCjGmaRDYA5Qa2dvpNHWVRo+ZpZPnVLzCpVm37VSBG473SyOKt HMgvO7cR1KF7qqgvz/LAWGNEeVlKWgbZuMS6FSMicCdQ8ttnrTruJichJ4cTpR2Wx6DS nbVMBimEc0K7sjzkkkzw1tGgQrrUeixRuzkQNhI327ifKcu3dZMUXAtg8OWceL5bIKpW GM0kOr5TLLgXAeBvqUDDHXr/Ar+1DxaYUyvImdef1/820D3HUbi8oVGa54+bpYGpCf5R S5bw== X-Gm-Message-State: APjAAAUCbd0oUsWWLrqXX44aeP5av/rbSEwLbHhKXbwtOrWQo76GfryZ NiZurpaTKejsOaQ2LlzIPjcf26ks X-Google-Smtp-Source: APXvYqzm2MNYHMLXTS4SOhq+lNYJ2s/xb7iNKkfxifmNvPdV0b2OKQVZDzFjKibK2HtfnF1f3lfWng== X-Received: by 2002:a5e:8513:: with SMTP id i19mr5923167ioj.119.1557964390644; Wed, 15 May 2019 16:53:10 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id 139sm1197302itv.38.2019.05.15.16.53.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2019 16:53:09 -0700 (PDT) From: Noam Postavsky References: <87ftujuvkd.fsf@zira.vinc17.org> Date: Wed, 15 May 2019 19:53:08 -0400 In-Reply-To: <87ftujuvkd.fsf@zira.vinc17.org> (Vincent Lefevre's message of "Thu, 27 Dec 2018 11:13:06 +0100") Message-ID: <878sv7ff6j.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Vincent Lefevre writes: > This is a regression: Emacs 25 did not hang at all. Should we backport Stefan's fix to emacs-26? Or specifically, backport [1: e7e92dc5d2], which is Stefan's fix on top of my fix for the loss-of-single-quote-fontification bug (Bug#35381). [1: e7e92dc5d2]: 2019-05-15 19:04:14 -0400 Fix merge of sgml-syntax-propertize-rules https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e7e92dc5d24ac3bcde69732bab6a6c3c0d9de97b From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 May 2019 10:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15580040602990 (code B ref 33887); Thu, 16 May 2019 10:55:02 +0000 Received: (at 33887) by debbugs.gnu.org; 16 May 2019 10:54:20 +0000 Received: from localhost ([127.0.0.1]:54406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRE1j-0000m9-M8 for submit@debbugs.gnu.org; Thu, 16 May 2019 06:54:19 -0400 Received: from cventin.lip.ens-lyon.fr ([140.77.13.17]:47588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRE1i-0000lz-9u for 33887@debbugs.gnu.org; Thu, 16 May 2019 06:54:18 -0400 Received: from vlefevre by cventin.lip.ens-lyon.fr with local (Exim 4.92) (envelope-from ) id 1hRE1g-0005Yd-Kv; Thu, 16 May 2019 12:54:16 +0200 Date: Thu, 16 May 2019 12:54:16 +0200 From: Vincent Lefevre Message-ID: <20190516105416.GA21149@cventin.lip.ens-lyon.fr> References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <878sv7ff6j.fsf@gmail.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.4+215 (cc8a201f) vl-117499 (2019-05-15) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On 2019-05-15 19:53:08 -0400, Noam Postavsky wrote: > Vincent Lefevre writes: > > > This is a regression: Emacs 25 did not hang at all. > > Should we backport Stefan's fix to emacs-26? Or specifically, backport > [1: e7e92dc5d2], which is Stefan's fix on top of my fix for the > loss-of-single-quote-fontification bug (Bug#35381). > > [1: e7e92dc5d2]: 2019-05-15 19:04:14 -0400 > Fix merge of sgml-syntax-propertize-rules > https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e7e92dc5d24ac3bcde69732bab6a6c3c0d9de97b It would be nice if this could be fixed quickly in emacs-26, hoping that it could be fixed in Debian before the next stable release. (I'm still using Emacs 25 because of this bug.) -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 May 2019 12:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155800897230803 (code B ref 33887); Thu, 16 May 2019 12:17:02 +0000 Received: (at 33887) by debbugs.gnu.org; 16 May 2019 12:16:12 +0000 Received: from localhost ([127.0.0.1]:54525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRFIx-00080A-5M for submit@debbugs.gnu.org; Thu, 16 May 2019 08:16:11 -0400 Received: from mail-it1-f176.google.com ([209.85.166.176]:38846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRFIt-0007rZ-33 for 33887@debbugs.gnu.org; Thu, 16 May 2019 08:16:09 -0400 Received: by mail-it1-f176.google.com with SMTP id i63so5807107ita.3 for <33887@debbugs.gnu.org>; Thu, 16 May 2019 05:16:07 -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=KnU8P3Vl5avaeg6brB4MISsF2NW+o1hvE69OmMApXno=; b=osvD7IboNwvDw1nHPcTKOR4bsBnNW3xIgXGrdt2nY2gpA+bzEm3b3ldumj0GGXdg0n cT3hancihaqUwgjaKoyWfO9T4Q0twX6C+1imc4f+w+SIYo8DU5+ssQprAIWEWTDLAqLH Sj+h1DlBsDU3LZRHQzUy8Bl0Irn2JAc5YMXuASIz2T4xn/8HONOTl5QM2MldOKK96FJV HkSYGTOzwcxwMMQkiwG2rP9zccqUl2Io3jB+fmprYgJ+4Bu+HbaohWIKaYJ0vLe9p81T /4t+vuPlvGF93WqBovEk9hq1NuMh1Xt51c5vCd+bm/0swyaZxzV0Sa+K+Pe/YXWFhOjr /InA== 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=KnU8P3Vl5avaeg6brB4MISsF2NW+o1hvE69OmMApXno=; b=rTA+Geo9cscIVO6XcmggufYG5ZyrKdZVyDTHdJBb+P4hMa6SMeRpchPRTIlgJzgr+w 8vb1sIUfzy1aF+JvyI3pcqKqKxXBOl23VaSiPjfnhWGWMFxJu/14D+edOVrU9yVAxLAb MbUdYjEakOTjIq9Xu2uLtjzJZxRd7nWDl3s317W9sOheorhmX9XQlvWJUxF9PeEJp4az ZsmRf8A3RG93EkoNaq+RsGozWDwyjeHqpogQGpNgo4UIGMX9qPQEKaYF0B0S6zKPOFmN L/kEgEjbBZKyei1is2n5I9diK4XERDsMY+MP52HvdQzEc1QFguZ+01FgLV1FMpxVFY16 oIxg== X-Gm-Message-State: APjAAAXcir7oRms++zDMFGejj+SKQ1tOplRyBBpgs2DVlB/XpkgTDlAL 4EN36M1mH/BnMjt/fpS9q95gfhvK X-Google-Smtp-Source: APXvYqwEMEnSNJkGFj4Ic/MYpmb3BhjqRigl7A0e4yQLE91G0y5I3lY5gCw+E2tFYqNmjX0hROZSgQ== X-Received: by 2002:a24:4453:: with SMTP id o80mr12134316ita.160.1558008961064; Thu, 16 May 2019 05:16:01 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id w20sm1700455ioa.18.2019.05.16.05.15.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 May 2019 05:15:59 -0700 (PDT) From: Noam Postavsky References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> Date: Thu, 16 May 2019 08:15:58 -0400 In-Reply-To: <878sv7ff6j.fsf@gmail.com> (Noam Postavsky's message of "Wed, 15 May 2019 19:53:08 -0400") Message-ID: <87pnoiegsh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Noam Postavsky writes: > [1: e7e92dc5d2]: 2019-05-15 19:04:14 -0400 > Fix merge of sgml-syntax-propertize-rules > https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e7e92dc5d24ac3bcde69732bab6a6c3c0d9de97b Uh, I goofed that one, Stefan fixed it [2: 9a74e5666b]. The corrected patch would be as follows: --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Backport-sgml-syntax-propertize-rules-speedup-Bug-33.patch Content-Description: patch >From 2221c244ee01c4c336ec860cf52a1ef37111ff19 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 15 May 2019 18:51:30 -0400 Subject: [PATCH] Backport sgml-syntax-propertize-rules speedup (Bug#33887) * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Reapply 2019-01-17 "* lisp/textmodes/sgml-mode.el: Try and fix bug#33887." taking into account 2019-05-09 "Recognize single quote attribute values in nxml and sgml (Bug#35381)" which means we have to handle single quotes as well. * test/lisp/textmodes/sgml-mode-tests.el (sgml-quote-works): New test. --- lisp/textmodes/sgml-mode.el | 21 +++++++++++++++------ test/lisp/textmodes/sgml-mode-tests.el | 7 +++++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 128e58810e..1c307d12b0 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -347,12 +347,21 @@ sgml-font-lock-keywords ("--[ \t\n]*\\(>\\)" (1 "> b")) ("\\(<\\)[?!]" (1 (prog1 "|>" (sgml-syntax-propertize-inside end)))) - ;; Quotes outside of tags should not introduce strings. - ;; Be careful to call `syntax-ppss' on a position before the one we're - ;; going to change, so as not to need to flush the data we just computed. - ("[\"']" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) - (goto-char (match-end 0))) - (string-to-syntax "."))))))) + ;; Quotes outside of tags should not introduce strings which end up + ;; hiding tags. We used to test every quote and mark it as "." + ;; if it's outside of tags, but there are too many quotes and + ;; the resulting number of calls to syntax-ppss made it too slow + ;; (bug#33887), so we're now careful to leave alone any pair + ;; of quotes that doesn't hold a < or > char, which is the vast majority. + ("\\(?:\\(?1:\"\\)[^\"<>]*[<>\"]\\|\\(?1:'\\)[^'<>]*[<>']\\)" + (1 (unless (memq (char-before) '(?\' ?\")) + ;; Be careful to call `syntax-ppss' on a position before the one + ;; we're going to change, so as not to need to flush the data we + ;; just computed. + (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) + (goto-char (1- (match-end 0)))) + (string-to-syntax "."))))) + ))) (defun sgml-syntax-propertize (start end) "Syntactic keywords for `sgml-mode'." diff --git a/test/lisp/textmodes/sgml-mode-tests.el b/test/lisp/textmodes/sgml-mode-tests.el index 7318a667b3..1c501abf38 100644 --- a/test/lisp/textmodes/sgml-mode-tests.el +++ b/test/lisp/textmodes/sgml-mode-tests.el @@ -130,5 +130,12 @@ sgml-with-content (sgml-delete-tag 1) (should (string= "Winter is comin'" (buffer-string))))) +(ert-deftest sgml-tests--quotes-syntax () + (with-temp-buffer + (sgml-mode) + (insert "a\"b c'd") + (should (= 1 (car (syntax-ppss (1- (point-max)))))) + (should (= 0 (car (syntax-ppss (point-max))))))) + (provide 'sgml-mode-tests) ;;; sgml-mode-tests.el ends here -- 2.11.0 --=-=-= Content-Type: text/plain [2: 9a74e5666b]: 2019-05-15 22:21:36 -0400 * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Fix typo https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9a74e5666b022098c63d0047c0df90c66e1aa64a --=-=-=-- From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 May 2019 14:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: vincent@vinc17.net, 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155801529721737 (code B ref 33887); Thu, 16 May 2019 14:02:02 +0000 Received: (at 33887) by debbugs.gnu.org; 16 May 2019 14:01:37 +0000 Received: from localhost ([127.0.0.1]:55985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRGwz-0005eX-Cs for submit@debbugs.gnu.org; Thu, 16 May 2019 10:01:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRGww-0005eH-8R for 33887@debbugs.gnu.org; Thu, 16 May 2019 10:01:35 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRGwq-0001vm-Ij; Thu, 16 May 2019 10:01:28 -0400 Received: from [176.228.60.248] (port=3578 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hRGwq-0005cp-1y; Thu, 16 May 2019 10:01:28 -0400 Date: Thu, 16 May 2019 17:01:19 +0300 Message-Id: <83lfz6cxcg.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <878sv7ff6j.fsf@gmail.com> (message from Noam Postavsky on Wed, 15 May 2019 19:53:08 -0400) References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Noam Postavsky > Date: Wed, 15 May 2019 19:53:08 -0400 > Cc: 33887@debbugs.gnu.org > > Vincent Lefevre writes: > > > This is a regression: Emacs 25 did not hang at all. > > Should we backport Stefan's fix to emacs-26? Or specifically, backport > [1: e7e92dc5d2], which is Stefan's fix on top of my fix for the > loss-of-single-quote-fontification bug (Bug#35381). > > [1: e7e92dc5d2]: 2019-05-15 19:04:14 -0400 > Fix merge of sgml-syntax-propertize-rules > https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e7e92dc5d24ac3bcde69732bab6a6c3c0d9de97b I'd like to leave this fix on master for a while, so that we could make sure it has no adverse consequences. Can we revisit this in a month's time, say? From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 May 2019 21:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155812897030518 (code B ref 33887); Fri, 17 May 2019 21:37:01 +0000 Received: (at 33887) by debbugs.gnu.org; 17 May 2019 21:36:10 +0000 Received: from localhost ([127.0.0.1]:59139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRkWP-0007w8-1X for submit@debbugs.gnu.org; Fri, 17 May 2019 17:36:10 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:35808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRkWM-0007vz-Im for 33887@debbugs.gnu.org; Fri, 17 May 2019 17:36:07 -0400 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 339352B9; Fri, 17 May 2019 23:36:03 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id A4C08C20780; Fri, 17 May 2019 23:36:02 +0200 (CEST) Date: Fri, 17 May 2019 23:36:02 +0200 From: Vincent Lefevre Message-ID: <20190517213602.GA11777@zira.vinc17.org> References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87pnoiegsh.fsf@gmail.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.4+211 (79563636) vl-117499 (2019-05-13) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2019-05-16 08:15:58 -0400, Noam Postavsky wrote: > The corrected patch would be as follows: [...] I've tried the combination of ca14dd1d4628094dd33d5d94694dcf5f29e843b8 7dab3ee7ab54b3c2e7bc24170376054786c01d6f and this patch against Debian's current source package. Emacs no longer hangs, but I get incorrect highlighting, for instance on the following XML file. "a' Highlighting starts to be wrong at the single-quote character. I've attached a screenshot obtained with the -Q option. Did I miss anything? -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) --Q68bSM7Ycu6FN28Q Content-Type: image/png Content-Disposition: attachment; filename="nxml.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAALsAAABzCAIAAABPSeTkAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAADoAAAA 7wC+k1D+AAAAB3RJTUUH4wUSASAOHQqwegAAABBjYU52AAADhQAABRAAAAAOAAAAMEESk4sA AAAGYktHRAD/AP8A/6C9p5MAABNcSURBVHja7V1pVFRHFi66gWbfZA80CC6IyiIgCGiQxagg iyCLC24oCMqmDCAgiKBj1JhB3JVxQZTEZdw4Y+ZEMy4czdG4HHE3JzPJTMZxZjSZc0wcTZyv fPq6aZvmAS2NWt+pH4+qW6+r6n7v1r2vqy+EEHKXoRtRW1uLNd+8efMbOn7CGMMYwxjTo9HQ 0ODv77937943mDEMDAwMDAwMDAxqgIXUNenDepehIWwpGARB6hmw7Pozv4Q0thRvG0RibbGO 7qv1WiKRxNBYRUfVAowxbypMTU1TU1ObmppMTEz4yim1B1DM7KTTN/+x+upTlPT6U4bmllyr sZVdykeNSy79BJWXf/kwuqxWR09f/p6qBaZtbMpvulH4+TdoXXjqe1xzRc/YDK1eXl579uyJ i4vT09Nj2ulZ8PPzW7ly5bVr1+7evdvY2CiRSPim7AOXcg9fzT96ffaOL0ZmlITPrUCNlYsb mrR1JXlHWsChMfOXe0VNTKiug+JT1x7k+7Yr4DEmyT85A62oT1y+E9dc0ZZQijg6Oh49ehRD unjxYnl5ef/+/ZmmNAxzc/OZM2d+9tln0MqpU6fy8vKkUqmCDPgBdcYsWie/xYi1dXDhGz8D TSGzivgmaB012GW4P9sVELIrDRw4EHS5cOECBrlv377ExEQDAwOmu+6GpaVlTU3NjRs3Wlpa Vq9eHRQUJBKJlEqCMUtbfjEw6/VqU/LKBmga+w5f4xoQhprQOWUCBYT7MTo6OqNHj96yZcut W7euXLlSVVWFGqbH7gNcBDyyly5diomJEYvFKiTBmKIT3yptyth1uurKY4U4GbqPq9wkUKCj nq++vn5aWtrNmzcxeHlni+G1Q1dXNyEhgftu7Ny5cwsXLmzLSwBjUJQ2zdndXHnxkXwNHGTo Pr5qq0AB4Yzx9fVdtmzZ5cuXb9++XVdXN2rUKC0tLaZHDaBv376LFi366quvQJ1Dhw4hVjIz MxPImMlr9kPT+ibmfI2TdyBqRuVWCxTg4Ojh3xZj7O3ts7Kyjh8/juGdOXMmNzcXNUxrmgeC I2xPu3fvhmLg3BgaGgphTPC0fGjaZ/x0viaycBVq+g0fLVCAg7Wr+6vODeDu7n7nzh04Lhs3 bgwNDVW9ezJoBr179y4qKpIPRlQwBu5wafP98nMPEDlD60GpOdVXn2QfuIhYSqAAB4ReJafv oQSkZLqFRKFwsZirqysMjLW1NdPLmwQVjAEcBvnmHbkGC8GV9PqTprYOHRLg4OwzPLPxLPei D4V/Q8jwlsbqzv3goMCr7bQAAwMDAwMDAwMDAwMDA8NbDlM94mxODNhXxQwCURRCni0jse5s JboEVwtSn0RCXBhjGIQhQEqXMc2PMaa7oEWIsaTNVpGWqlaxiOhpv7jmLzokwMFIl0qqAIbR Vve3kDHm+mReILmSQ8z0ehZj3K3JgSnkUSUdxn8Xk08mkt6yAxTEzpg0ppCfltDWh+WkNpro v3S54HvdyCc148i9EvK0mhSHkBVjyS9LyfcLic97ggQ44Iao/2cp/YjHVWTfZGIvd5wr2Jne JMadrI+lw0D3s5mkj9yhxaZpVOCbQtodd8Y1V8y668C7vyM5mU6meMtWpqsY7kx2JL5Y9FPp ik+JZhnjaUd+rCA/VJDKCDJhMJkTQM5lkoRBL1ol2qQljyp7+Rgy0YvUJdChHkyVmQT8+XUB iR9EzmRQsc/TaN/visnhqYIEOPNzfBblAQiR7ElX40E5uZ4vW/3R/ehN7haQI1PJDF86Etzn /FzZFJI8SIY/rYfYzkR6zRUVxky9wAN2OYd+Oka+JpoMtu3sjSwNSX4wnTzu9ZdCsiSCemev ovB9KhA9QDOMOZ1BnlSTQTatLL/VywM80BDGBi3ygEpQEyCVEaJ6FL2eOoRej3s+i3Ux9IkX IgBgH0E9FopHRB9aMyegFWNAOP5Q4PYJtMbepGftSkPsqTX9VxkdBqzgTF9iqCu4s40R2ZNC DSxM/a4kEt6HqqEtZA2jnxHmqoFJYsfBR2MbagsNyVTATu7XcxgnaspCZYTIDaLXUW4yJlWN okZLiADwp5nU+kpa2wOYvU8ntWJMTpCsNTuQ1gx17Il+jK6YGlSYQzyHmMWGWFoj1G/Hrj/J i2iL2hGe7E2F/RyUt8LKgXxc+c2IzgiowIje9KPLw1RZIPBeIYhFl01xMkLMHSbTq+/zWVSE UxIIEQD+WkR+XkJ3GfmCGmzf8oxJ9JCNgTNL8G/Uyxg1LjUcuAXDyf+q6JAEuVN4Yqb7kOY5 tMM/SsiqSFV7W5ATVYyTmfLWQ6mydVwd1RkBFRjpQkdYHNKmAKYAMykPqRntsjW+HUL8vESQ APC3YurWYONTKHAk5RnDu1avjzFqWWqMaks8taDwzOCSxw0kHTthP9CG/G4c+c8iOpkL82is 1Ksn/XyMMxic+pVi/2QqYC73y91AJ5lrohbGgJSIpFRAIGMQsGhwV8KDVBpKbi+gY/i2iCwO pzWdB5x2bE9/nv0ielR4seFgSidvoSEmIQpFRG1p2KpS5+XWC4cUY4a95AF7iRpoUV2MKQ6R ecQKr3A6xBh3a5mD1c3wtie/LqURHKJIuGtikfpu3c+Svngw0u1B0XWkG53tzflk/EDS15IM k1IfJf6lemAR75fSoBGhNVQC9xMO3cXsF4uiFsbg+bk1n5rxvGAa6ve3IimeNPZGmNYhxsBf hK1CyQygakPR6a4fR7hZkZKRirHb2/zOF4H9nefmlCuwOp6yH+ZSHV/Lk7WeTKdGUf59TBcZ w4Vsf5hCN37uI359/o4uQNoxxnDvvdCRe++FomA4GdQMzsA4m7dpHeHBdGlvbg/YlxEwe9l1 37taBgYGBgYGBgYGBgYGBgYKLS0tBwcHLp+UhYWFjY1N5+5jqKfrbG2uo46EILraYtzKxEDC tNMTIZFI7t69m5OTg+uampoTJ0507j6T3/d+dmDZIKlN14dUkjASt/J2YZmLGGMEQF9X5962 kmPlM5hqXiNEIrGugdFrZYxYLFadc1VdjMkaMwz3CR3sqt5pvqNQyBmuq284rqRmwbHb1Vef Lrv+rOzsv2MWrZUYvfg6S2BCb9WMAUvKy8uPHz9+69YtiF24cGHx4sVGRkZdYYy5kf68yMAr H+eYGSoOTCwSfb2h4MsVWa3cGpXT9O/neLI6fUqIN4wTY4gMSnOGm9o6YPmiS9cMTZztMTpx bMGKqiuPp21s4roITOito6PT0NAQH09PuMybN2/16tXyrba2tmAJuicnJ0dGRhYVFd24caOu ru7V+0R49vmianZvG3MVsxju7rwjJ/GnxiXg1qml6Xo6igevJ47wQlP8sEGtnhOV08QnXl6d g14P6svXzIoe7GT7ThNFdc5wsbaOwj8ZwGriKbR06svXdDGht7a2toKJAmlwK2dnZ+E3sTQx zI8Ovl6bD73+ZVPhkokRrrYWSiUvrc6+uXa+qHVaVyHTHOJiX5M27l87yvARZ5dnzgz3Rez2 bnFFeM5w7O5YO4fBflLPgNA5pTRTZvAHrxqSriT0hhMDinh4eGCny8rKAmNGjBB0HtjGzGjP /JTHn1Y9aqzclZcU7tlH1HaS37E+/aHvtAi/Tk8TYTns05HSqU/2Vv/YULEhIxY17wpjBOUM 19LC2sFi83kPueIeFqM8DOl4Qm8tLS1QhDNR8ggPDxfSPaCfFCR4uKt80ggv7fYOlsEd+Xvd QiU67uA0DSQ6C2KH/29vFT76VVfprYWQnOGBk+dh4Sb8drudm6e+iTniiCExqc+XMlZBstMJ veFoYwBwoQYMGAC/GzsaXGnURERECArEdLSnh/k0/3YOlPeP35esmh7Zlp/BcasgVonpEj7N 4AHOW7Lif9hV8cv+pU1l0+ICBr6LactV5AxPrz9Z/MV3RG5VQmYVyS9l1xN6I9pqbm6Wp1dG RoZwxsjcKanN72aO+8/ORaDFhVXzECv1Mm7lTh0sToUpMtZX8p633WlKrcxKJ4TeXrcAN/92 S9HilHDUsPdsSnKGp9efKvhM9t+xtUSivCMt/FKqJaE34jL5eBu+1LFjxzrBGA4IjrA9/blq NlQL54bnh7uj9a/7ly6d/IHSXqqn6e1ij75P91WDc1G+bmKRiDDIQz5nePi8xfR/CORU9ZL2 kXoNm7r+cGnzfX4p1ZLQG2YJ/MjPz3dycvL29t68efP58+c7zRge/ewtV0wda/QynNmePQEh N9xkpcKqp+n2nlVJwkh7C/Z/VoSEvhK9SR9/ynuCM7Yc8xk/XekG3xXbVltbyzu827Ztg3fV dcbIw9HSFF7q+oxYDU7z3YKxlR0Cztea7huGCrHba/qnJh/PjMKe0tYbmu6cJsMbALgd27In LEoMY0vBwMDAwMDAwMDAwKB2mBroOVubG0jYkSIGYSgaH/LswLJYf5YCuktwtbWoz00KGeTC GMMgCNz3520d0GGMUT+0tIjSL585iLS0VLSKRSL+EOerpzmFCHAw0tNV/WUkhtFW97eQMW2d qdY4Y9wdrQ8UTXnUWIlh/Hf34k8KJsof+LUzN25ckMId7324q7x2djR/ihu+143a/Jq0cfe2 lTzdV10cH7Ji6thf9i/9/vcLfVzfEyLAATdE/T+3l3Lfiu8rnCz/3WTwAGfcJGao+/qMWAwD 3c8uz+xjJ0sa3lQ2DQLfbCpEd9wZ11zptgNZ6j/frvpMtWYZ4+ls92NDxQ+7KipTIiYEDp4z OuDch5kJgS9Od0t0tFtq8qDs5aljJo7wqpubgKEeLE7lTQL+/HpDQfywQWeWZUDs88o09P1u S/HhkqlCBDjzc7xyFngAQiQHe2I1HtSXX6/N51d/tHc/3OTuhoIjpVNnhPliJLjP+ZWypOFJ wR4ZH/ijHmI7cxNxzRUVxky9UNv5doFnqgvHvw+BaD/NJA0/vTTjyd5q+d+dwPJbmbxICAYN YWzQIt8KlaAGWwBPiOpJNPHm1JFDcD3u+SzWpcfgiRciAGAfQT0Wiv+ICM8+qAF35RkDwvGn srZnT0CNwhkJje9KXTrf3qEz1dyvwsI8NJA0HDsOPhrbUFsCDfnJEIAYX4NxoqYsMZQnRO44 ms47yteNZ1LVpFEwWkIEgD9VzIT1lbS2BzB7nxZMkmdMTpQsaXh2ZCBqhvZ17IF+TCfPt3fo TDX36zK/PsqThsPKgXxc+U3ciE4IqMCIgb3x0eVJYSosEHivEMSiy6bMOJ4Qc8cO4/Xq+3wW FcnhIIEQAeCvm4t+/mQJdhn5ghps3/KMSQySJQ3nzBL8G/UyRo1L3eHz7cLPVANBbk5QjFMb h1sPLUzl13H1jKhOCKjAyMEuGCEc0rYEMAWYSfkaqZUZumydG6+aEFC5EAHgb1uL4dZg41Mo cCTlGcO7Vq+PMWpZ6q6eb2/3TLXG33rx6leK/YWTIYAoj68JdHPiXRO1MAakRCSlYpACGYOA RYO7kprPt7d1ppqDQy9TTN7CSDNMQhSKiNrSpFXuWz6RDBxSjBn2km+CvUQNtKguxsDC8R6x wiucDjHG3dGad7C6Ga/xfLvCmeqeEF1H+rhhtjfXzh8fMLCvneWw/lL4KPxvp2ER728vRdCI 0BoqgfsJh+7iR9ncoqiFMXh+bq2bDzOeFx2MUL//e1Ypwz0ReyNM6xBj4C/CVqFkjgmA2lDU kkBJCLr7fLvG3+AhsL+znppTrsDqQHN8K3R8bU0e33qyOh1GUf59TBcZw4Vsfyiego2f+4hf n7+j46Iq4Yzh3nuhI/feC0XBcDKoGZyBcbY2b8s6woN5rb89w76MgNmrt9079ONZBgYGBgYG BgYGBgYGBrWDZdtm6Bg0lW3bQuqa9GG9y9AQpoI3CRrMti31DFh2/ZlfQhrTwpsEFdm2eYjE 2mIdJce6tEQiiaGxio6qBRhjeig6mm2bw5TaAyhmdtLpm/9YffUpSnr9KUNzS67V2Mou5aPG JZd+gsrLv3wYXVarkDxXtcC0jU35TTcKP/8GrQtPfY9rrugZmxGW0FuD6Fy2bQ7ZBy7lHr6a f/T67B1fjMwoCZ9bgRorFzc0aetK8o60gENj5i/3ipqYUF0HxaeuPcj3bVfAY0ySf3IGWlGf uHwnrrmiLaGcZgm9uxtdzLbNMwbqjFm0Tn6LEWvTh943fgaaQmYV8U3QOmqwy3B/tisgZFdi Cb27A2rMtg3GLG35xcCs16tNySsboGnsO3yNa0AYakLnlAkUEO7HvNMJvbsB6sm2/ZIxRSe+ VdqUset01ZXHCnEydB9XuUmgQEc933c0oXc3QC3ZtnnGoChtmrO7ufLiI/kaOMjQfXzVVoEC whnDEnp3E7qSbbtdxkxesx+a1jeRnYFy8g6kyXNzqwUKcHD08G+LMSyht2bQuWzb7TImeFo+ NO0zfjpfE1m4iv5bkeGjBQpwsHZ1f9W5ISyhd09Ah7Jtt8sYuMOlzffLzz1A5AytB6XmVF99 kn3gImIpgQL8i8GS0/dQAlIy3UKiULhYjCX07lloN9t2u4wBHAb55h25xmfkTq8/aWrr0CEB Ds4+wzMbz3Iv+lD4N4QMPQgCs20LevHj3A8OioqM3O0KMPR0sGzbDAwMDAwMDAwMDAwMDAwM DAwMDAxvBP4PhpSU8CW7g5oAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDUtMTdUMjM6MzI6 MTQrMDI6MDDDmFHaAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA1LTE3VDIzOjMyOjE0KzAy OjAwssXpZgAAABl0RVh0U29mdHdhcmUAZ25vbWUtc2NyZWVuc2hvdO8Dvz4AAAAASUVORK5C YII= --Q68bSM7Ycu6FN28Q-- From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2019 04:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15581529572809 (code B ref 33887); Sat, 18 May 2019 04:16:02 +0000 Received: (at 33887) by debbugs.gnu.org; 18 May 2019 04:15:57 +0000 Received: from localhost ([127.0.0.1]:59453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRqlI-0000jB-9B for submit@debbugs.gnu.org; Sat, 18 May 2019 00:15:56 -0400 Received: from mail-it1-f178.google.com ([209.85.166.178]:40507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRqlG-0000iy-8B for 33887@debbugs.gnu.org; Sat, 18 May 2019 00:15:55 -0400 Received: by mail-it1-f178.google.com with SMTP id g71so15204309ita.5 for <33887@debbugs.gnu.org>; Fri, 17 May 2019 21:15:54 -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=uqkqhN+fX54lx6WmWcR+d4/ca+bdOnHj+/faXyWisnQ=; b=jUYA0PqjWNzJ5Twv3h5LXLZnKzZwn64jqQ80tcVeACaKpu1lwIqZkRLJYZZxi92zuc YdgfQBeedb3aWI0a7XHH8liZo1TmMC91lPis5AT7uyK/p+P0VXg4fNHaSXrkRrK9D3p9 LuquP57OVOOYb0aOdWZQ/GEUXHJgrLu0t38hbAFS/nV9fqStxSY7i/JgDRt5jUlg5xBZ L7C+Hwa/snnLW2Jmkse31nNvoJGV8Tyd5IKFqar8Zgjy04NeBdnSOWXHYhLMdRv5g0Xo x1FHjrvPYFyz8Umsa+Y7FVyVRWuZu6Vta3ni16Icd6axjedgSiwVvjfoCoFyH/J8BuYQ 08fQ== 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=uqkqhN+fX54lx6WmWcR+d4/ca+bdOnHj+/faXyWisnQ=; b=B2QWcq44kOL4MIgpBg4p3NcOK/qTbBFJJdj5Q2WL7u5MwGK0rSzWdZaFsa+7y1w+/Q RvvpuIgCTQBKIp6wY/PxbiLwT31WbWBZaMm4c/NMrv9xfK1YAv1fG/bNsNBFp6z/5+1k dwmcRV4zKBEyUPar9eG5RxyEfLO/kYy81Vk5Km8eRQQe1oqg2xL43JLiQ4nTY1Kh6lJ5 8Ql4+31OtJFNFhiWmQmezSVG3iAgeeoPSgxvj8XJiOaxaCHquUXwgcbKHN22qYjAk+FJ 8uyzYwCu+V9qyN2iFgM+1BURDmgR9GsOZs0qum7eXPkUaz34gRRZUhekh7fvJY/AUVby fVEw== X-Gm-Message-State: APjAAAWtUBhdukJr98atVTT8/ukgoZzw50LWexFoPCRMFg59D3dGQAQj KL+H6B+7UBUtouTFSWHVa8tgTBx9 X-Google-Smtp-Source: APXvYqzFCiV8V3WDueSBEFc9JUc/51/vMM5uSq0gAG/pqzuAo6wrQte2L/aavmQ013MnHbuyT3nyJQ== X-Received: by 2002:a24:5c90:: with SMTP id q138mr4880223itb.96.1558152948535; Fri, 17 May 2019 21:15:48 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id q18sm3494943iog.17.2019.05.17.21.15.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 May 2019 21:15:47 -0700 (PDT) From: Noam Postavsky References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> Date: Sat, 18 May 2019 00:15:39 -0400 In-Reply-To: <20190517213602.GA11777@zira.vinc17.org> (Vincent Lefevre's message of "Fri, 17 May 2019 23:36:02 +0200") Message-ID: <875zq8e6tw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Vincent Lefevre writes: > I've tried the combination of > > ca14dd1d4628094dd33d5d94694dcf5f29e843b8 > 7dab3ee7ab54b3c2e7bc24170376054786c01d6f > > and this patch against Debian's current source package. > > Emacs no longer hangs, but I get incorrect highlighting, > for instance on the following XML file. > > > > "a' > > > > Highlighting starts to be wrong at the single-quote character. > I've attached a screenshot obtained with the -Q option. > > Did I miss anything? Ah, I didn't get the mixed quote handling right. Here's the fix for master: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-Bug-33887-for-mixed-quote-usage.patch Content-Description: patch >From 4677edd8dd65b5d956732821e78794f35b275418 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 18 May 2019 00:04:01 -0400 Subject: [PATCH] Fix Bug#33887 for mixed quote usage * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Only skip syntax-ppss for matched quotes. * test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax): Expand test. --- lisp/textmodes/sgml-mode.el | 4 ++-- test/lisp/textmodes/sgml-mode-tests.el | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 1b064fb825..e3cf56aa0e 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -345,8 +345,8 @@ sgml-font-lock-keywords ;; the resulting number of calls to syntax-ppss made it too slow ;; (bug#33887), so we're now careful to leave alone any pair ;; of quotes that doesn't hold a < or > char, which is the vast majority. - ("\\(?:\\(?1:\"\\)[^\"<>]*[<>\"]\\|\\(?1:'\\)[^'<>]*[<>']\\)" - (1 (unless (memq (char-before) '(?\' ?\")) + ("\\([\"']\\)[^<>\"']*[<>\"']" + (1 (unless (eq (char-after (match-beginning 1)) (char-before)) ;; Be careful to call `syntax-ppss' on a position before the one ;; we're going to change, so as not to need to flush the data we ;; just computed. diff --git a/test/lisp/textmodes/sgml-mode-tests.el b/test/lisp/textmodes/sgml-mode-tests.el index a900e8dcf2..ffcc2cd840 100644 --- a/test/lisp/textmodes/sgml-mode-tests.el +++ b/test/lisp/textmodes/sgml-mode-tests.el @@ -161,11 +161,18 @@ sgml-with-content (should (string= "&&" (buffer-string)))))) (ert-deftest sgml-tests--quotes-syntax () - (with-temp-buffer - (sgml-mode) - (insert "a\"b c'd") - (should (= 1 (car (syntax-ppss (1- (point-max)))))) - (should (= 0 (car (syntax-ppss (point-max))))))) + (dolist (str '("a\"b c'd" + "a'b c\"d" + "\"a'" + "'a\"" + "\"a'\"" + "'a\"'")) + (with-temp-buffer + (sgml-mode) + (insert str) + ;; Check that last tag is parsed as a tag. + (should (= 1 (car (syntax-ppss (1- (point-max)))))) + (should (= 0 (car (syntax-ppss (point-max)))))))) (provide 'sgml-mode-tests) ;;; sgml-mode-tests.el ends here -- 2.11.0 --=-=-= Content-Type: text/plain And the correponding patch against emacs-26: --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Backport-sgml-syntax-propertize-rules-speedup-Bug-33.patch Content-Description: patch >From 3a1a36b0b42772f35c70fb7e996ba8fed787e1c2 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 15 May 2019 18:51:30 -0400 Subject: [PATCH] Backport sgml-syntax-propertize-rules speedup (Bug#33887) * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Reapply 2019-01-17 "* lisp/textmodes/sgml-mode.el: Try and fix bug#33887." taking into account 2019-05-09 "Recognize single quote attribute values in nxml and sgml (Bug#35381)" which means we have to handle single quotes as well. * test/lisp/textmodes/sgml-mode-tests.el (sgml-quote-works): New test. --- lisp/textmodes/sgml-mode.el | 21 +++++++++++++++------ test/lisp/textmodes/sgml-mode-tests.el | 14 ++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 128e58810e..f8a37c3820 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -347,12 +347,21 @@ sgml-font-lock-keywords ("--[ \t\n]*\\(>\\)" (1 "> b")) ("\\(<\\)[?!]" (1 (prog1 "|>" (sgml-syntax-propertize-inside end)))) - ;; Quotes outside of tags should not introduce strings. - ;; Be careful to call `syntax-ppss' on a position before the one we're - ;; going to change, so as not to need to flush the data we just computed. - ("[\"']" (0 (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) - (goto-char (match-end 0))) - (string-to-syntax "."))))))) + ;; Quotes outside of tags should not introduce strings which end up + ;; hiding tags. We used to test every quote and mark it as "." + ;; if it's outside of tags, but there are too many quotes and + ;; the resulting number of calls to syntax-ppss made it too slow + ;; (bug#33887), so we're now careful to leave alone any pair + ;; of quotes that doesn't hold a < or > char, which is the vast majority. + ("\\([\"']\\)[^<>\"']*[<>\"']" + (1 (unless (eq (char-after (match-beginning 1)) (char-before)) + ;; Be careful to call `syntax-ppss' on a position before the one + ;; we're going to change, so as not to need to flush the data we + ;; just computed. + (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) + (goto-char (1- (match-end 0)))) + (string-to-syntax "."))))) + ))) (defun sgml-syntax-propertize (start end) "Syntactic keywords for `sgml-mode'." diff --git a/test/lisp/textmodes/sgml-mode-tests.el b/test/lisp/textmodes/sgml-mode-tests.el index 7318a667b3..8d0bb88163 100644 --- a/test/lisp/textmodes/sgml-mode-tests.el +++ b/test/lisp/textmodes/sgml-mode-tests.el @@ -130,5 +130,19 @@ sgml-with-content (sgml-delete-tag 1) (should (string= "Winter is comin'" (buffer-string))))) +(ert-deftest sgml-tests--quotes-syntax () + (dolist (str '("a\"b c'd" + "a'b c\"d" + "\"a'" + "'a\"" + "\"a'\"" + "'a\"'")) + (with-temp-buffer + (sgml-mode) + (insert str) + ;; Check that last tag is parsed as a tag. + (should (= 1 (car (syntax-ppss (1- (point-max)))))) + (should (= 0 (car (syntax-ppss (point-max)))))))) + (provide 'sgml-mode-tests) ;;; sgml-mode-tests.el ends here -- 2.11.0 --=-=-=-- From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2019 14:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15581908817545 (code B ref 33887); Sat, 18 May 2019 14:49:01 +0000 Received: (at 33887) by debbugs.gnu.org; 18 May 2019 14:48:01 +0000 Received: from localhost ([127.0.0.1]:32782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS0cy-0001xV-W0 for submit@debbugs.gnu.org; Sat, 18 May 2019 10:48:01 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:36076) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS0cx-0001xM-15 for 33887@debbugs.gnu.org; Sat, 18 May 2019 10:48:00 -0400 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id CBBB128F; Sat, 18 May 2019 16:47:56 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 88053C20169; Sat, 18 May 2019 16:47:56 +0200 (CEST) Date: Sat, 18 May 2019 16:47:56 +0200 From: Vincent Lefevre Message-ID: <20190518144756.GA21327@zira.vinc17.org> References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <875zq8e6tw.fsf@gmail.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.4+211 (79563636) vl-117499 (2019-05-13) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) There's still an issue. On the following XML file text text the part after the comment is highlighted as a comment. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2019 14:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15581913478252 (code B ref 33887); Sat, 18 May 2019 14:56:01 +0000 Received: (at 33887) by debbugs.gnu.org; 18 May 2019 14:55:47 +0000 Received: from localhost ([127.0.0.1]:32786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS0kV-000292-A0 for submit@debbugs.gnu.org; Sat, 18 May 2019 10:55:47 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:36090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS0kU-00028u-9y for 33887@debbugs.gnu.org; Sat, 18 May 2019 10:55:46 -0400 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 7EC5728F; Sat, 18 May 2019 16:55:43 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 4497FC20169; Sat, 18 May 2019 16:55:43 +0200 (CEST) Date: Sat, 18 May 2019 16:55:43 +0200 From: Vincent Lefevre Message-ID: <20190518145543.GA21077@zira.vinc17.org> References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190518144756.GA21327@zira.vinc17.org> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.4+211 (79563636) vl-117499 (2019-05-13) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2019-05-18 16:47:56 +0200, Vincent Lefevre wrote: > There's still an issue. On the following XML file > > > text > > text > > > the part after the comment is highlighted as a comment. And on the following XML file too: ]> ab'cd text -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2019 14:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15581914348391 (code B ref 33887); Sat, 18 May 2019 14:58:02 +0000 Received: (at 33887) by debbugs.gnu.org; 18 May 2019 14:57:14 +0000 Received: from localhost ([127.0.0.1]:32790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS0lt-0002BG-NK for submit@debbugs.gnu.org; Sat, 18 May 2019 10:57:13 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:36100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS0ls-0002B9-Fs for 33887@debbugs.gnu.org; Sat, 18 May 2019 10:57:12 -0400 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id EE84028F; Sat, 18 May 2019 16:57:10 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id BB03DC2148F; Sat, 18 May 2019 16:57:10 +0200 (CEST) Date: Sat, 18 May 2019 16:57:10 +0200 From: Vincent Lefevre Message-ID: <20190518145710.GB21077@zira.vinc17.org> References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <20190518145543.GA21077@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190518145543.GA21077@zira.vinc17.org> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.4+211 (79563636) vl-117499 (2019-05-13) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2019-05-18 16:55:43 +0200, Vincent Lefevre wrote: > And on the following XML file too: > > > > ]> > ab'cd > text > I actually meant ]> ab'cd text -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2019 15:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15581916748845 (code B ref 33887); Sat, 18 May 2019 15:02:01 +0000 Received: (at 33887) by debbugs.gnu.org; 18 May 2019 15:01:14 +0000 Received: from localhost ([127.0.0.1]:32794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS0pl-0002Ib-8w for submit@debbugs.gnu.org; Sat, 18 May 2019 11:01:13 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:36108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS0pi-0002IS-TU for 33887@debbugs.gnu.org; Sat, 18 May 2019 11:01:11 -0400 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 0738928F; Sat, 18 May 2019 17:01:10 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id B4F6FC20169; Sat, 18 May 2019 17:01:09 +0200 (CEST) Date: Sat, 18 May 2019 17:01:09 +0200 From: Vincent Lefevre Message-ID: <20190518150109.GC21077@zira.vinc17.org> References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <20190518145543.GA21077@zira.vinc17.org> <20190518145710.GB21077@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190518145710.GB21077@zira.vinc17.org> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.4+211 (79563636) vl-117499 (2019-05-13) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) And another one: text text The second text is highlighted as a comment. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2019 18:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15582053925481 (code B ref 33887); Sat, 18 May 2019 18:50:02 +0000 Received: (at 33887) by debbugs.gnu.org; 18 May 2019 18:49:52 +0000 Received: from localhost ([127.0.0.1]:32977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS4P2-0001QK-7Z for submit@debbugs.gnu.org; Sat, 18 May 2019 14:49:52 -0400 Received: from mail-it1-f182.google.com ([209.85.166.182]:50463) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS4P0-0001Q3-Th for 33887@debbugs.gnu.org; Sat, 18 May 2019 14:49:51 -0400 Received: by mail-it1-f182.google.com with SMTP id i10so17040421ite.0 for <33887@debbugs.gnu.org>; Sat, 18 May 2019 11:49:50 -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=l6Du0BUVJNDcP0//i0019JIvxGxEXMKk0mvtKFCmfok=; b=ahTrmPQVQ9ivgHHyISicSVFrQwMt2swyY6cB28SJYX0Cf3OTIRHt4O2tyezt129oPT gxZCFpC+uZ1CZ5x7JjTXTjfMQNOmtO7TKCz19AOEnyUNUPJcU8DpkX9oJq261uPZvRq5 0DN2hd1lBZtRi6DLPtSb8ju1Wj3QZPc7iiJcU95TPI6IeqR7eJcj1fbPQb2Y180pBeHe uVs6KyvVoKrd0xJbyL+1sUxRlZqZ2CEBIAtlt91L1j46OFGmVnDWnWiPz6qlvlv5uHcq +5sFs4x6FmZ1vduaY33SZHbFLJ7SvbskpHdrEaDm3CSDwdS9k2Hf4Fs4CHqBxG/QtuFC uz0Q== 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=l6Du0BUVJNDcP0//i0019JIvxGxEXMKk0mvtKFCmfok=; b=RW1IRxNuEavc6pFdyFNjHii4t300GUOBA9KTPmpXNo5SEY+Bsv6GYVan/n9MhIFSts iyQFzLXBRTKs5OlT40x3aTbtXFHgnMX9ZgzAgyC4QKwc8eJ9/lRgfwsgE7zotjpjlJ2t MJT7Z/jN4WAqyUNKVzKtlDhktSb/j+BbYuL7ulqSksR8788w7hhzfN9oWQs/hESBnBk6 K9h2e5SL1S8dWm+ZBKbOGCtEYy1dYRDcN0dnV7RyWfgzr3AKWsITBTz+E5S7/MHVq1xx 0YGw2/SVohyr0oHyGeFcDJLB6l0pT2pIZwiX9qlP1tyC6FfXRy7LUoVON7bBv5QsjFsu DtUA== X-Gm-Message-State: APjAAAU/2CTjiP2Dx1tkArYBuHAUCCMoI9Eg5hLNnoz/qCV6XvZpVzYS tDUb0JyCfhceCEolRqYrD3HSuSlq X-Google-Smtp-Source: APXvYqzdgUUK1bvzPp0lAbTnGfhfMdHhGm+uwz5sONocEjpR2xVVKtFapBvSAMKQapB8VhLVRPIbbQ== X-Received: by 2002:a24:3d8f:: with SMTP id n137mr23549116itn.96.1558205384913; Sat, 18 May 2019 11:49:44 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id u13sm3749896iof.22.2019.05.18.11.49.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 May 2019 11:49:43 -0700 (PDT) From: Noam Postavsky References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> Date: Sat, 18 May 2019 14:49:42 -0400 In-Reply-To: <20190518144756.GA21327@zira.vinc17.org> (Vincent Lefevre's message of "Sat, 18 May 2019 16:47:56 +0200") Message-ID: <87r28vd2d5.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Vincent Lefevre writes: > There's still an issue. On the following XML file > > > text > > text > > > the part after the comment is highlighted as a comment. > And another one: > > > text > > text > > > The second text is highlighted as a comment. Right, this is a collision between the syntax rules. The following patch fixes it, though perhaps it would be better to just search for the end of the comment in the ("\\(<\\)!--" (1 "< b")) rule instead? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-sgml-syntax-handling-of-quotes-in-comments.patch Content-Description: patch >From a866e4f4b556fb4a346fa68c62296f10966690a1 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 18 May 2019 13:18:19 -0400 Subject: [PATCH] Fix sgml syntax handling of quotes in comments * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Make sure not to skip over comment ender when searching for quotes. * test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax): Add a some more cases. --- lisp/textmodes/sgml-mode.el | 11 ++++++++--- test/lisp/textmodes/sgml-mode-tests.el | 16 +++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index e3cf56aa0e..1af1d1eaef 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -350,9 +350,14 @@ sgml-font-lock-keywords ;; Be careful to call `syntax-ppss' on a position before the one ;; we're going to change, so as not to need to flush the data we ;; just computed. - (if (prog1 (zerop (car (syntax-ppss (match-beginning 0)))) - (goto-char (1- (match-end 0)))) - (string-to-syntax "."))))) + (let ((ppss (syntax-ppss (match-beginning 0)))) + (if (prog1 (zerop (car ppss)) ; Outside tag. + (goto-char (1- (match-end 0))) + ;; If we're in a comment, don't skip over comment + ;; ender. + (when (nth 4 ppss) + (skip-chars-backward "- \t\n"))) + (string-to-syntax ".")))))) ))) (defun sgml-syntax-propertize (start end) diff --git a/test/lisp/textmodes/sgml-mode-tests.el b/test/lisp/textmodes/sgml-mode-tests.el index ffcc2cd840..7e1ddf4047 100644 --- a/test/lisp/textmodes/sgml-mode-tests.el +++ b/test/lisp/textmodes/sgml-mode-tests.el @@ -166,13 +166,15 @@ sgml-with-content "\"a'" "'a\"" "\"a'\"" - "'a\"'")) - (with-temp-buffer - (sgml-mode) - (insert str) - ;; Check that last tag is parsed as a tag. - (should (= 1 (car (syntax-ppss (1- (point-max)))))) - (should (= 0 (car (syntax-ppss (point-max)))))))) + "'a\"'" + "" + "")) + (ert-info (str :prefix "Test string: ") + (sgml-with-content + str + ;; Check that last tag is parsed as a tag. + (should (= 1 (car (syntax-ppss (1- (point-max)))))) + (should (= 0 (car (syntax-ppss (point-max))))))))) (provide 'sgml-mode-tests) ;;; sgml-mode-tests.el ends here -- 2.11.0 --=-=-= Content-Type: text/plain > > ]> > > ab'cd > text > This is a different issue, I think the problem is that sgml-syntax-propertize-inside doesn't handle nesting in the DTD definition ]>. The patch below just avoids calling sgml-syntax-propertize-inside on the prolog in nxml-mode (but the problem remains in sgml-mode). Though you'll hit Bug#18871/23668 if you try to edit the DTD. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Don-t-sgml-syntax-propertize-inside-XML-prolog.patch Content-Description: patch >From 9a50fc38b537d570f739c428a57c66557152151b Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 18 May 2019 14:37:51 -0400 Subject: [PATCH] Don't sgml-syntax-propertize-inside XML prolog * lisp/nxml/nxml-mode.el (nxml-syntax-propertize): New function. (nxml-mode): Use it as the syntax-propertize-function. * test/lisp/nxml/nxml-mode-tests.el (nxml-mode-doctype-and-quote-syntax): New test. --- lisp/nxml/nxml-mode.el | 16 +++++++++++++++- test/lisp/nxml/nxml-mode-tests.el | 8 ++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index ab035b927e..7c39c5023c 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -423,6 +423,20 @@ nxml-parent-document-set (when rng-validate-mode (rng-validate-while-idle (current-buffer))))) +(defvar nxml-prolog-end) ;; nxml-rap.el +(defun nxml-syntax-propertize (start end) + "Syntactic keywords for `nxml-mode'." + ;; Like `sgml-syntax-propertize', but skip prolog. + (setq start (max start nxml-prolog-end)) + (if (>= start end) + (goto-char end) + (goto-char start) + (sgml-syntax-propertize-inside end) + (funcall + (syntax-propertize-rules sgml-syntax-propertize-rules) + start end))) + + (defvar tildify-space-string) (defvar tildify-foreach-region-function) @@ -518,7 +532,7 @@ nxml-mode (nxml-with-invisible-motion (nxml-scan-prolog))))) (setq-local syntax-ppss-table sgml-tag-syntax-table) - (setq-local syntax-propertize-function #'sgml-syntax-propertize) + (setq-local syntax-propertize-function #'nxml-syntax-propertize) (add-hook 'change-major-mode-hook #'nxml-cleanup nil t) ;; Emacs 23 handles the encoding attribute on the xml declaration diff --git a/test/lisp/nxml/nxml-mode-tests.el b/test/lisp/nxml/nxml-mode-tests.el index 92744be619..2bbf92bc96 100644 --- a/test/lisp/nxml/nxml-mode-tests.el +++ b/test/lisp/nxml/nxml-mode-tests.el @@ -78,5 +78,13 @@ nxml-mode-tests-correctly-indented-string (should-not (equal (get-text-property squote-txt-pos 'face) (get-text-property dquote-att-pos 'face)))))) +(ert-deftest nxml-mode-doctype-and-quote-syntax () + (with-temp-buffer + (insert "\n]>\n'") + (nxml-mode) + ;; Check that last tag is parsed as a tag. + (should (= 1 (car (syntax-ppss (1- (point-max)))))) + (should (= 0 (car (syntax-ppss (point-max))))))) + (provide 'nxml-mode-tests) ;;; nxml-mode-tests.el ends here -- 2.11.0 --=-=-=-- From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 May 2019 00:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155822502921004 (code B ref 33887); Sun, 19 May 2019 00:18:02 +0000 Received: (at 33887) by debbugs.gnu.org; 19 May 2019 00:17:09 +0000 Received: from localhost ([127.0.0.1]:33325 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS9Vl-0005Si-9M for submit@debbugs.gnu.org; Sat, 18 May 2019 20:17:09 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:36298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hS9Vj-0005SZ-7n for 33887@debbugs.gnu.org; Sat, 18 May 2019 20:17:07 -0400 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 7C1A62BE; Sun, 19 May 2019 02:17:04 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 1FB0AC20CC7; Sun, 19 May 2019 02:17:04 +0200 (CEST) Date: Sun, 19 May 2019 02:17:04 +0200 From: Vincent Lefevre Message-ID: <20190519001704.GA5467@zira.vinc17.org> References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87r28vd2d5.fsf@gmail.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.4+211 (79563636) vl-117499 (2019-05-13) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) There's an issue with the following XML file: don't text > don't text where highlighting becomes wrong starting at the second '. However, even though > is valid, I normally use > instead. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 May 2019 17:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15582878395098 (code B ref 33887); Sun, 19 May 2019 17:44:01 +0000 Received: (at 33887) by debbugs.gnu.org; 19 May 2019 17:43:59 +0000 Received: from localhost ([127.0.0.1]:35482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSPqp-0001KA-6f for submit@debbugs.gnu.org; Sun, 19 May 2019 13:43:59 -0400 Received: from mail-it1-f169.google.com ([209.85.166.169]:51507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSPqn-0001Jv-Lo for 33887@debbugs.gnu.org; Sun, 19 May 2019 13:43:58 -0400 Received: by mail-it1-f169.google.com with SMTP id m3so15621030itl.1 for <33887@debbugs.gnu.org>; Sun, 19 May 2019 10:43:57 -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=Ttt7oYQQGG48fSh5MjQOckL46wX4RcEFU/9P408/77Q=; b=Jjt75BRugSCdNOes1Lxs5hHwBRRAGnVrGKFFzQIOmO9RGz2rp6pit2kpMfKMFKM+eB tnDN9JPZgJ1nYnN0QEAM1L+WTy/DhjbyoKYkVIzEKAoW+l8bY4o5Kv/KZMcruTO4pVXH pV8onFaons8oz8bDICQpyXPC5VCV02jx9aMa9F9FVOVyC1oUtmUMIYj0oZPQO6ronxyh rz044Yqhdq7XpXRYI2DKKpE8f/V+/uOdKIqCvJJPf5HhRbYu4nYCwhzOUPv6ml0H2aqJ 4fMvj7GTEGLIeSaig0wrnpD5GoZM4hJsuzYclWsgDHJFov1No5o/slTz06pGsBZz0GvY MjOQ== 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=Ttt7oYQQGG48fSh5MjQOckL46wX4RcEFU/9P408/77Q=; b=kklAnn7CkwnFgPBPtR+Cy/PrTDhoSJZLabunCSB8PtRKRf2mv9j9ScknOPnVSpZSIn YVOxaY064VxZILq9E/hYMBxBBrFKp5Stab3HBnguAzblgeq6qka5UpNmoiDgZeXole8P Axu+S5iuf5ZGbaB9Dwckv38SYrFSJvacAHPOpdLYkXP0KOM46jge4lBYXamAknfeMuGX f45nlEkiTKMH4gRRkJiCMeGXTqZ8WKhQifviIPHXOLiRePnils6l/brUT6qLZP8P/1+k GoIrcTQwtY1HBAMv85xYpL2/Zp41XEWVUAvem61aW2IVohncFXlsH8jqJ+LiijlLmkcw gdxg== X-Gm-Message-State: APjAAAXuMFnAv2hNSgNy5gNIyKA7hKBSzJz2pFMAr8ahMakp9a5doxgd /ycAYjT8SSW+VEeHEeDu2Tqoa+JI X-Google-Smtp-Source: APXvYqxVzu2On0EaWLSVnbyIShm1qBi3KTCaJ7xjFfSYDBOGdowjPdGw9/mGQ2XHMA9C6Uh8bNL9NA== X-Received: by 2002:a24:e1cb:: with SMTP id n194mr6589920ith.178.1558287831922; Sun, 19 May 2019 10:43:51 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id b81sm3425880itc.33.2019.05.19.10.43.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 19 May 2019 10:43:51 -0700 (PDT) From: Noam Postavsky References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> Date: Sun, 19 May 2019 13:43:50 -0400 In-Reply-To: <20190519001704.GA5467@zira.vinc17.org> (Vincent Lefevre's message of "Sun, 19 May 2019 02:17:04 +0200") Message-ID: <87k1embaqx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Vincent Lefevre writes: > There's an issue with the following XML file: > > > don't > text > > > don't > text > > > where highlighting becomes wrong starting at the second '. > > However, even though > is valid, I normally use > instead. Hmm, I can't see a way to handle this case without making the syntax propertizing slow again. Stefan, any ideas? From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 May 2019 18:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Vincent Lefevre , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155829174512031 (code B ref 33887); Sun, 19 May 2019 18:50:01 +0000 Received: (at 33887) by debbugs.gnu.org; 19 May 2019 18:49:05 +0000 Received: from localhost ([127.0.0.1]:35528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSQrp-00037x-3O for submit@debbugs.gnu.org; Sun, 19 May 2019 14:49:05 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSQrn-00037O-5w for 33887@debbugs.gnu.org; Sun, 19 May 2019 14:49:04 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AFEBF442784; Sun, 19 May 2019 14:48:57 -0400 (EDT) Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 90E3E442782; Sun, 19 May 2019 14:48:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1558291736; bh=ylbF3ZYrpZeFscWjYBdFeww9n7+IYC8HRUmfnJWxGns=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Lh5dxyl4Z24BUOQ2YEmpHp6RsjAV34F+6cRL+fEXbKGYhVxJLGJsb8ClV4YV5ItAD 0X7lzNmzvPVdzbleJEO+EH+j+Tl15g+5yMN6ou9ksjCQlhJZa4qwm9Iu0jyXb6Ykw9 0dBK9fw+lsHfbnXt7ZV/7CALFRoaN4+6NAnUIgUlezzmOlQx286a+GjFN7Y2O/6n6S HF7zgMrfLzNNnbs2NpKLRQJfka1y/ffYcXATaI4W8h2h05K+W4OYEECsaPyesEd59H W/v38SJ03UuZk3nE4AgMauq7rjE9/DXcICHiKvkDvSycCtkWtE2uKJwHFFOGMGnyfn awldbnHL7c8oQ== Received: from pastel (unknown [216.154.3.168]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id 5F96E120264; Sun, 19 May 2019 14:48:56 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> Date: Sun, 19 May 2019 14:48:55 -0400 In-Reply-To: <87k1embaqx.fsf@gmail.com> (Noam Postavsky's message of "Sun, 19 May 2019 13:43:50 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Hmm, I can't see a way to handle this case without making the > syntax propertizing slow again. Stefan, any ideas? Can you summarize the origin of the problem in his example? Stefan From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 May 2019 19:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Vincent Lefevre , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155829262413619 (code B ref 33887); Sun, 19 May 2019 19:04:02 +0000 Received: (at 33887) by debbugs.gnu.org; 19 May 2019 19:03:44 +0000 Received: from localhost ([127.0.0.1]:35533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSR60-0003Xb-7W for submit@debbugs.gnu.org; Sun, 19 May 2019 15:03:44 -0400 Received: from mail-io1-f50.google.com ([209.85.166.50]:43143) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSR5x-0003XK-DB for 33887@debbugs.gnu.org; Sun, 19 May 2019 15:03:42 -0400 Received: by mail-io1-f50.google.com with SMTP id v7so9304805iob.10 for <33887@debbugs.gnu.org>; Sun, 19 May 2019 12:03:41 -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=AyWn6PXOfS3XfLvxByxclafokhMwi8yzBDjRLTWeEKI=; b=vh8Mzn+CuZXDNay8HPd00BWvQ/jCiSRGzSIZ6IO7an0moyNQwMB2sERcu+2wbn1uQQ NmVxnxu4Zpln9oIKLKoNE+DuiEDS0QV+Cf6hYgB6u9DA0Mbi5yd2dAzE0wHQC6ZmZqxR anSGYK0X5T+wn3kq82uTOmhYgQr2eatI9aU+GEam7OHq4B/ulNA0e+Oov0JDxsAyvmJt yPkJvFdfFOr2R0QykMvMUf22S0oCLGhFZgnxLaEbFf10+Fw8CLJQcFl4rnRn4cE2Ds0Z dfkBzcdWuNN5Zadv+y6YNb85izKcNihArBNEtd+MroDpvqM53vEGRrHztHvn2aCqnfkO k29Q== 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=AyWn6PXOfS3XfLvxByxclafokhMwi8yzBDjRLTWeEKI=; b=i0XH14yTiQoAushEJz9vc83DfHmpZ0G1+zYXsI1vZliV2KAV0guxgddcpy0DmE9vxJ VXQKQkIGYzJhqKevWGqtfbvXS9spk4BHfSRp1BkWZsq1zKuzCEvvlnMZn0wOzX+VYu3T l2quXIa3aSbrZ50h/830letdVS6/fN3Oao0rk+8JRavmexhUjUKERL0FNCJ0IFsg2vxq RClHTE87VSp1qtpEYjPV443Gj4/JVvlluJmv5NPQANe0xPALgais1hphbi6mep/xdZE0 Xx4wUZMKg5uIxQT29N8WgZcx31x867ThwZwHjBbbIeTXO0QKJ8KhOwgkyA5dONIDYxpc S4cg== X-Gm-Message-State: APjAAAXeS1i8KMduQLTXghCgWc0BKZ3erInx3ZvYQJRsHodWNAB3T32C lrUIkJoFoiXM9NW9XqWhj5zvvCXX X-Google-Smtp-Source: APXvYqzkeNd81JzIRaxx8I/strc4BqgKcG+0Bf6zvth1DlZmfsyAKcJmM83j/9VypoXK/0pzSfD+Mg== X-Received: by 2002:a5d:9f02:: with SMTP id q2mr7947659iot.5.1558292615016; Sun, 19 May 2019 12:03:35 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id p20sm4963505ioj.63.2019.05.19.12.03.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 19 May 2019 12:03:34 -0700 (PDT) From: Noam Postavsky References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> Date: Sun, 19 May 2019 15:03:33 -0400 In-Reply-To: (Stefan Monnier's message of "Sun, 19 May 2019 14:48:55 -0400") Message-ID: <87h89qb722.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: > Can you summarize the origin of the problem in his example? >1 (syntax-ppss) on the location of "1" in the above, gives (-1 ...). And then (syntax-ppss) on the "/" will give (0 ...). So the syntax propertize rule for quote use of (zerop (car (syntax-ppss))) no longer works correctly to see whether it's inside or outside a tag. ">" outside of tags should be set to syntax ".", but I would assume that adding a syntax-propertize rule which calls syntax-ppss for every ">" (to check whether it's inside a tag or not) will be very slow, just like calling it for every quote was. From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 May 2019 19:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Vincent Lefevre , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155829387215923 (code B ref 33887); Sun, 19 May 2019 19:25:02 +0000 Received: (at 33887) by debbugs.gnu.org; 19 May 2019 19:24:32 +0000 Received: from localhost ([127.0.0.1]:35551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSRQ8-00048l-JJ for submit@debbugs.gnu.org; Sun, 19 May 2019 15:24:32 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:6676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSRQ6-00048Y-In for 33887@debbugs.gnu.org; Sun, 19 May 2019 15:24:31 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id F2EE244278F; Sun, 19 May 2019 15:24:24 -0400 (EDT) Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E398E44278D; Sun, 19 May 2019 15:24:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1558293863; bh=HSTJbuHTwD3h7l+WmFcMAwrMblD8C01lQwkfvXUX/r8=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=CeQZyzLVdCMXQZ+lf2y23v5q0lvqk6jedtwltI9mTa2BFqZhBpK3WS5eYB0QYqG4j 23N/tduG1yMXVvZh4Gd3acBtY3HCmNi2tUmez01RUG9oSrGmR/wdDPEpCDe0zNeWMQ CDb5f5lcZkoHVtczGpGqsfxSJ4SYgviEeGw48HBZefPVG62Z6Qc9/Y45VI0sKM4FLj 6NzaV4iNuurwwcHv69OWdtSgJ7oxlry4wbnOxu4w8kKCCWMP6SmYwdj/L00IJ1OQ8A v3DodLLaAr48Pg1HiHf7RxmyYAJ9MbO7zK59EeMqcCeCf8QA6TOcOLtNpEkW0t3DlA VSMZAoc3S2XSA== Received: from pastel (unknown [216.154.3.168]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id B1284120B02; Sun, 19 May 2019 15:24:23 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> Date: Sun, 19 May 2019 15:24:22 -0400 In-Reply-To: <87h89qb722.fsf@gmail.com> (Noam Postavsky's message of "Sun, 19 May 2019 15:03:33 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> Can you summarize the origin of the problem in his example? > > >1 > > (syntax-ppss) on the location of "1" in the above, gives (-1 ...). And > then (syntax-ppss) on the "/" will give (0 ...). So the syntax > propertize rule for quote use of (zerop (car (syntax-ppss))) no longer > works correctly to see whether it's inside or outside a tag. > > ">" outside of tags should be set to syntax ".", but I would assume that > adding a syntax-propertize rule which calls syntax-ppss for every ">" > (to check whether it's inside a tag or not) will be very slow, just like > calling it for every quote was. Oh, damn! Hmm... Stefan From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 May 2019 11:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15583528797156 (code B ref 33887); Mon, 20 May 2019 11:48:01 +0000 Received: (at 33887) by debbugs.gnu.org; 20 May 2019 11:47:59 +0000 Received: from localhost ([127.0.0.1]:36118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSglq-0001rM-TY for submit@debbugs.gnu.org; Mon, 20 May 2019 07:47:59 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:37072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSglo-0001rB-QB for 33887@debbugs.gnu.org; Mon, 20 May 2019 07:47:57 -0400 Received: from smtp-zira.vinc17.net (2a02-8429-80cd-3101-328d-99ff-fe25-ad3f.rev.sfr.net [IPv6:2a02:8429:80cd:3101:328d:99ff:fe25:ad3f]) by joooj.vinc17.net (Postfix) with ESMTPSA id 7E8CE28F; Mon, 20 May 2019 13:47:52 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 18D1AC2086B; Mon, 20 May 2019 13:47:52 +0200 (CEST) Date: Mon, 20 May 2019 13:47:52 +0200 From: Vincent Lefevre Message-ID: <20190520114752.GA9035@zira.vinc17.org> References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87r28vd2d5.fsf@gmail.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.4+211 (79563636) vl-117499 (2019-05-13) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) There's an issue with the following XML file, which does not have any special character, except a single quote in the middle of the text. 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 Note that the newline character before the is important. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 May 2019 20:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Vincent Lefevre , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15583852454102 (code B ref 33887); Mon, 20 May 2019 20:48:01 +0000 Received: (at 33887) by debbugs.gnu.org; 20 May 2019 20:47:25 +0000 Received: from localhost ([127.0.0.1]:38114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSpBs-000146-QM for submit@debbugs.gnu.org; Mon, 20 May 2019 16:47:25 -0400 Received: from mail-it1-f177.google.com ([209.85.166.177]:54346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hSpBn-00013n-Bk for 33887@debbugs.gnu.org; Mon, 20 May 2019 16:47:22 -0400 Received: by mail-it1-f177.google.com with SMTP id a190so1283297ite.4 for <33887@debbugs.gnu.org>; Mon, 20 May 2019 13:47:19 -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=V0eMec8Puk7kvckPQiccpTavfW8BwLCmCvfKbX1qisc=; b=jrgrZ4u8quY3S/OgLeZojZn4xRtzpQP8+GcxT1J8A1IUpV/v7d5vdP1KFT0eWJqGtx KUzf+UBTJJSRpWIkdPJv95z60BvQtJt4Y6VvDbpJOlfPj3oxKyZGVt6CMNXAHhFQ0Sxq 5kXy5dU/ww0vyTUVqHUi2NfDxLR1XQC5Vh4oA1o3h9fOvuqnE99RMUCgChKft1Jl/E9B VXarsn8cqDe+m8akIulupUT+OKuNOEmdzjL9tHf3o9GiZB7QOHHnWDCYE3zxeeljweIl zQEgfo10D7bNI6IEEJx+W1JpA8NKaV+9yJwyVE4aKJvkMR6Th6nTjJ5GGC57fj13qfgB eOwg== 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=V0eMec8Puk7kvckPQiccpTavfW8BwLCmCvfKbX1qisc=; b=feQwjRefDIuOQ256G3WgfFpFqn7rIHVkrfYgYOTTRm8QophABzw/TU0LksGSaUPXYM JzM/pjAj6ynsZy7oRDSbckpfYfpEeHu6jm1bq1EsmTyX40eFDNgDixhoEoGxMVmPBfV0 eEZeVSzUvi4ONnskosJ4/I/Z71vYju4JxEsqX9kyyBOjzYHSZw401G+1nHfCgUVadZhD +lkhGSY5P1jW362mGWE2aapfI6bn9+u26CldVy49J5W1NXRuwdY9sHiK+bVG7QhHyl2q Sgi4GB9Ad5ZTKRIXUnurhpOzKBwCDfp0STAL6f/3+qXpFHoJnWiuBVYtnqCLhc7ZKuoF Z3AA== X-Gm-Message-State: APjAAAV2ETdx++bbjyw0x+9nQDzNO9JHrDT0wj5pIuaBaGZvkxIOhpxk hGwz8cv5XQoGbpg8ku0huJd1EJ2p X-Google-Smtp-Source: APXvYqz6GfPefy/sHCoDweiVQ+JEym2Lsi2sb6J+1spQJtn2+6CQ08l/7jO/1NXt6vpCWdSgMfXCkA== X-Received: by 2002:a24:303:: with SMTP id e3mr826849ite.156.1558385233497; Mon, 20 May 2019 13:47:13 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id 3sm292949itm.25.2019.05.20.13.47.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 May 2019 13:47:12 -0700 (PDT) From: Noam Postavsky References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> Date: Mon, 20 May 2019 16:47:11 -0400 In-Reply-To: (Stefan Monnier's message of "Sun, 19 May 2019 15:24:22 -0400") Message-ID: <87o93wam5s.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) --=-=-= Content-Type: text/plain > There's an issue with the following XML file, which does not have > any special character, except a single quote in the middle of the > text. > > > 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789'012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 > > > > Note that the newline character before the is important. Right, this is due to chunking by syntax-propertize. Here's the fix: --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Handle-lone-quote-500-characters-away-from-XML-tag-B.patch Content-Description: patch >From 2025fa25f76fd8a2df46fca8807ca386372757d5 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Mon, 20 May 2019 16:04:24 -0400 Subject: [PATCH 1/2] Handle lone quote 500+ characters away from XML tag (Bug#33887) Because syntax-propertize works in small buffer chunks, the rule for finding quotes which don't contain angle brackets failed to trigger when the angle bracket was outside of the current chunk. * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Match quotes on lines with no other angle bracket or quote too (the syntax-propertize chunk is extended to cover whole lines). * test/lisp/nxml/nxml-mode-tests.el (nxml-mode-quote-in-long-text): New test. --- lisp/textmodes/sgml-mode.el | 9 +++++++-- test/lisp/nxml/nxml-mode-tests.el | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 137745fbc1..b555db7b76 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -353,8 +353,13 @@ sgml-font-lock-keywords ;; the resulting number of calls to syntax-ppss made it too slow ;; (bug#33887), so we're now careful to leave alone any pair ;; of quotes that doesn't hold a < or > char, which is the vast majority. - ("\\([\"']\\)[^<>\"']*[<>\"']" - (1 (unless (eq (char-after (match-beginning 1)) (char-before)) + ;; We also check quotes which are unpaired to end of line, + ;; otherwise we miss the case where the quote might "contain" an + ;; angle bracket outside of the current syntax-propertize chunk + ;; (this relies on `syntax-propertize-wholelines' being enabled). + ("\\([\"']\\)[^<>\"']*\\([<>\"']\\|$\\)" + (1 (unless (eq (char-after (match-beginning 1)) + (char-after (match-beginning 2))) ;; Be careful to call `syntax-ppss' on a position before the one ;; we're going to change, so as not to need to flush the data we ;; just computed. diff --git a/test/lisp/nxml/nxml-mode-tests.el b/test/lisp/nxml/nxml-mode-tests.el index 2bbf92bc96..0916a1e652 100644 --- a/test/lisp/nxml/nxml-mode-tests.el +++ b/test/lisp/nxml/nxml-mode-tests.el @@ -86,5 +86,27 @@ nxml-mode-tests-correctly-indented-string (should (= 1 (car (syntax-ppss (1- (point-max)))))) (should (= 0 (car (syntax-ppss (point-max))))))) +(ert-deftest nxml-mode-quote-in-long-text () + (with-temp-buffer + (nxml-mode) + (insert "" + ;; `syntax-propertize-wholelines' extends chunk size based + ;; on line length, so newlines are significant! + (make-string syntax-propertize-chunk-size ?a) "\n" + "'" + (make-string syntax-propertize-chunk-size ?a) "\n" + "") + ;; If we just check (syntax-ppss (point-max)) immediately, then + ;; we'll end up propertizing the whole buffer in one chunk (so the + ;; test is useless). Simulate something more like what happens + ;; when the buffer is viewed normally. + (cl-loop for pos from (point-min) to (point-max) + by syntax-propertize-chunk-size + do (syntax-ppss pos)) + (syntax-ppss (point-max)) + ;; Check that last tag is parsed as a tag. + (should (= 1 (- (car (syntax-ppss (1- (point-max)))) + (car (syntax-ppss (point-max)))))))) + (provide 'nxml-mode-tests) ;;; nxml-mode-tests.el ends here -- 2.11.0 --=-=-= Content-Type: text/plain Note that you have to be sure to recompile sgml-mode.el AND nxml-mode.el after applying these patches, 'make' isn't smart enough to do it automatically (yes, I figured this out the hard way). >> >1 >> >> (syntax-ppss) on the location of "1" in the above, gives (-1 ...). And >> then (syntax-ppss) on the "/" will give (0 ...). So the syntax >> propertize rule for quote use of (zerop (car (syntax-ppss))) no longer >> works correctly to see whether it's inside or outside a tag. >> >> ">" outside of tags should be set to syntax ".", but I would assume that >> adding a syntax-propertize rule which calls syntax-ppss for every ">" >> (to check whether it's inside a tag or not) will be very slow, just like >> calling it for every quote was. Oh, I figured it out, we can just look at (nth 9 ppss), because the list of open parens is still okay, regardless of unmatched close parens. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0002-Handle-outside-SGML-XML-tags-Bug-33887.patch Content-Description: patch >From d1520ab5b94d0f130955800ea11222a3702a5519 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Mon, 20 May 2019 16:29:04 -0400 Subject: [PATCH 2/2] Handle ">" outside SGML/XML tags (Bug#33887) * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Check the list of open parens rather than current depth, the latter is not reliable. * test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax): Extend test for this case. --- lisp/textmodes/sgml-mode.el | 4 +++- test/lisp/textmodes/sgml-mode-tests.el | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index b555db7b76..052201e5ee 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -364,7 +364,9 @@ sgml-font-lock-keywords ;; we're going to change, so as not to need to flush the data we ;; just computed. (let ((ppss (syntax-ppss (match-beginning 0)))) - (if (prog1 (zerop (car ppss)) ; Outside tag. + ;; Can't rely on depth (nth 0 ppss), because we don't + ;; mark ">" outside of tags. + (if (prog1 (null (nth 9 ppss)) ; Outside tag. (goto-char (1- (match-end 0))) ;; If we're in a comment, don't skip over comment ;; ender. diff --git a/test/lisp/textmodes/sgml-mode-tests.el b/test/lisp/textmodes/sgml-mode-tests.el index 09941fe6f1..d6913863d6 100644 --- a/test/lisp/textmodes/sgml-mode-tests.el +++ b/test/lisp/textmodes/sgml-mode-tests.el @@ -138,13 +138,16 @@ sgml-with-content "\"a'\"" "'a\"'" "" - "")) + "" + ;; Yes, ">" is technically valid outside tags! + ">'" + )) (ert-info (str :prefix "Test string: ") (sgml-with-content str ;; Check that last tag is parsed as a tag. - (should (= 1 (car (syntax-ppss (1- (point-max)))))) - (should (= 0 (car (syntax-ppss (point-max))))))))) + (should (= 1 (- (car (syntax-ppss (1- (point-max)))) + (car (syntax-ppss (point-max)))))))))) (provide 'sgml-mode-tests) ;;; sgml-mode-tests.el ends here -- 2.11.0 --=-=-=-- From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 May 2019 01:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155840076930993 (code B ref 33887); Tue, 21 May 2019 01:07:02 +0000 Received: (at 33887) by debbugs.gnu.org; 21 May 2019 01:06:09 +0000 Received: from localhost ([127.0.0.1]:38342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hStEH-00083o-6Q for submit@debbugs.gnu.org; Mon, 20 May 2019 21:06:09 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:37562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hStEC-00083R-1M for 33887@debbugs.gnu.org; Mon, 20 May 2019 21:06:07 -0400 Received: from smtp-zira.vinc17.net (2a02-8429-80cd-3101-328d-99ff-fe25-ad3f.rev.sfr.net [IPv6:2a02:8429:80cd:3101:328d:99ff:fe25:ad3f]) by joooj.vinc17.net (Postfix) with ESMTPSA id D9677B2; Tue, 21 May 2019 03:06:00 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 9B21CC20169; Tue, 21 May 2019 03:06:00 +0200 (CEST) Date: Tue, 21 May 2019 03:06:00 +0200 From: Vincent Lefevre Message-ID: <20190521010600.GA23463@zira.vinc17.org> References: <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87o93wam5s.fsf@gmail.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.4+211 (79563636) vl-117499 (2019-05-13) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thanks for the fixes. Also I don't think that in a text node, the " and ' characters should be interpreted for highlighting. In particular, ' is generally used as an apostrophe, not as a quote. For instance, this looks strange: This "shouldn't" and "can't" be right. These characters have no special meaning in a text node. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 May 2019 12:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155844163230653 (code B ref 33887); Tue, 21 May 2019 12:28:01 +0000 Received: (at 33887) by debbugs.gnu.org; 21 May 2019 12:27:12 +0000 Received: from localhost ([127.0.0.1]:38892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT3rM-0007yL-4J for submit@debbugs.gnu.org; Tue, 21 May 2019 08:27:12 -0400 Received: from mail-it1-f173.google.com ([209.85.166.173]:51020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hT3rK-0007y4-Th for 33887@debbugs.gnu.org; Tue, 21 May 2019 08:27:11 -0400 Received: by mail-it1-f173.google.com with SMTP id i10so4618577ite.0 for <33887@debbugs.gnu.org>; Tue, 21 May 2019 05:27:10 -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=aw9Q4f34i6EohB1MvqNCdoflzo9KuAX5PSiEMp8n65A=; b=olX8K6UAD37Nx2KTS9noouMg5yb6S4aurMByXjv6wzzCKklfrXWk9FwXU/QVgb5Pk+ DqNwpKosKeOJD1OIMcPEP336oozK1Usm3KTiKhXemLdf33TtsPjOj+Ns4rTCNKrkWKHa z1ALQOUbkjZ2QdNyv/NmoVq5IslpLJM2/RnHnfy6cCQA08fTD86n7PlCLCKJKOCIJQlw 8Vi5czjBGAT2wz934BEdy7V4HKvw44o74dkqLvhiwZCrs8DuXng5nOy/U6hNTYaMQEbw rRXMtVwVJSNacsCwtahbI9zcoThlK+uX6PFHT0ovWVGQT6muy+5qPpC4LP6jNg8PgaOg V6kQ== 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=aw9Q4f34i6EohB1MvqNCdoflzo9KuAX5PSiEMp8n65A=; b=C4VAk7JQXsW9zeQqki4r7Z+VSe/AQVPCA3AIyov8JcKzSXKf0OTNRGJpBskKXWi2ok h+HAl4ESfBT7RB1KywKWWNpKfqAdXn9aWOjWX6lZ036FqGPuwW7KvFyHGru8IrC9U6kn Fx92qXMKhqRM13O/lWLR66Zot+9HEOGz7rfgzD1DlRZ/VGe3d6xhsFv1g+6IDqJGpIJP ZVJqLiQjMZom/hF1Kc2YA00LhfrSl18KVN3BYydTBUPV0mEwYoFRopWX+mKAejedNqP/ BPVBQfSbmpuCtuLVXdEjGiC77Z2P8h26w1AE90T2DulSwmmYHelNtc19BdZk2WawbZsE RbpQ== X-Gm-Message-State: APjAAAV1+2QvwiBvRJ6jL1z6bmSV0zbzOR2A2vqDs9CcKtWfNnlIhsYa kDR5rhFocBVOVItPPjX/QAtlZAfa X-Google-Smtp-Source: APXvYqxePd5XdgZR+9em6f9tEdwWT7vRJZ6J8a0+8irWv6m7Kax8/WGLEy3CFf3AzSiv6Mjl6StDeg== X-Received: by 2002:a24:6212:: with SMTP id d18mr3412309itc.2.1558441624014; Tue, 21 May 2019 05:27:04 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id d71sm1307734itc.18.2019.05.21.05.27.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 May 2019 05:27:03 -0700 (PDT) From: Noam Postavsky References: <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> <20190521010600.GA23463@zira.vinc17.org> Date: Tue, 21 May 2019 08:27:01 -0400 In-Reply-To: <20190521010600.GA23463@zira.vinc17.org> (Vincent Lefevre's message of "Tue, 21 May 2019 03:06:00 +0200") Message-ID: <87imu49ene.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Vincent Lefevre writes: > Also I don't think that in a text node, the " and ' characters should > be interpreted for highlighting. In particular, ' is generally used > as an apostrophe, not as a quote. For instance, this looks strange: > > This "shouldn't" and "can't" be right. > > These characters have no special meaning in a text node. Hmm, right, it should be possible to fix the crossing quotes in the above case, but even the simpler "oops" 'oops' shows the same highlighting. This seems directly due to "we're now careful to leave alone any pair of quotes that doesn't hold a < or > char". So uh, Stefan, how was that supposed to work exactly? From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2019 14:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Vincent Lefevre , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155853354618265 (code B ref 33887); Wed, 22 May 2019 14:00:02 +0000 Received: (at 33887) by debbugs.gnu.org; 22 May 2019 13:59:06 +0000 Received: from localhost ([127.0.0.1]:42623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTRlq-0004kX-5d for submit@debbugs.gnu.org; Wed, 22 May 2019 09:59:06 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTRlm-0004k1-OY for 33887@debbugs.gnu.org; Wed, 22 May 2019 09:59:04 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D953181164; Wed, 22 May 2019 09:58:56 -0400 (EDT) Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B929780615; Wed, 22 May 2019 09:58:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1558533535; bh=K7aUrAEELkjeg/xEEquiHRwLdQYZztP6UwD9KHiVhKc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=i5N2WMFL5FGXHJxsyOYrAoRyT/CJPQz3oVtHa3ywwzDT+F9u9T2Vy89AL1WHK9oez k3h1ei+iUIPE+X1mox1T1T8x8z0giGjtEA1WFLiAm8hCYN5hLbHDEM4VoqqvJrfuvK Fqm2Ks9UIv60Zk6dpdOX/HwUP3uMLMpPnRGDDmrWTjFKkmCtyuMPtX++JhAyUiv7zN I6YOwph/zNXu7w8jIkwQZPU+ngGX6KsXXgglvZjqgRjoWtuCngZTmKCKELuHcalaLj vZQFGUJZCxgYGDpy9Gcztv1k1WdzvJWsXNMqtN6/VtTVdaWM/yu88STmpIhh/QekHN 4636lEY18fQZA== Received: from pastel (unknown [216.154.3.168]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id 7762F120B1B; Wed, 22 May 2019 09:58:55 -0400 (EDT) From: Stefan Monnier Message-ID: References: <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> <20190521010600.GA23463@zira.vinc17.org> <87imu49ene.fsf@gmail.com> Date: Wed, 22 May 2019 09:58:54 -0400 In-Reply-To: <87imu49ene.fsf@gmail.com> (Noam Postavsky's message of "Tue, 21 May 2019 08:27:01 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.174 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > shows the same highlighting. This seems directly due to "we're now > careful to leave alone any pair of quotes that doesn't hold a < or > > char". So uh, Stefan, how was that supposed to work exactly? Remember: when I wrote this, we only supported "..." and not '...'. Stefan From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2019 15:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Noam Postavsky , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155853985728574 (code B ref 33887); Wed, 22 May 2019 15:45:02 +0000 Received: (at 33887) by debbugs.gnu.org; 22 May 2019 15:44:17 +0000 Received: from localhost ([127.0.0.1]:42734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTTPd-0007Qo-EQ for submit@debbugs.gnu.org; Wed, 22 May 2019 11:44:17 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:38556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTTPa-0007Qd-JL for 33887@debbugs.gnu.org; Wed, 22 May 2019 11:44:15 -0400 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id F294F4FF; Wed, 22 May 2019 17:44:11 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id AA6CFC2062C; Wed, 22 May 2019 17:44:11 +0200 (CEST) Date: Wed, 22 May 2019 17:44:11 +0200 From: Vincent Lefevre Message-ID: <20190522154411.GA15113@zira.vinc17.org> References: <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> <20190521010600.GA23463@zira.vinc17.org> <87imu49ene.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.4+219 (8f739fbe) vl-117499 (2019-05-20) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2019-05-22 09:58:54 -0400, Stefan Monnier wrote: > > shows the same highlighting. This seems directly due to "we're now > > careful to leave alone any pair of quotes that doesn't hold a < or > > > char". So uh, Stefan, how was that supposed to work exactly? > > Remember: when I wrote this, we only supported "..." and not '...'. I'm not sure what you mean by that, but the single quotes are not the only issue. In general, you don't know the quoting rules in a text node used by the underlying language (if any), even if you have only double quotes. For instance, a text node may contain C or shell code, which can be: "a string with \"double quotes\"..." And one does not expect this to be interpreted as two pairs of double-quoted text ("a string with \" and "..."). In short, you should leave text nodes with no specific highlighting, as this was the case with Emacs 25. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2019 16:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: Noam Postavsky , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155854093230315 (code B ref 33887); Wed, 22 May 2019 16:03:02 +0000 Received: (at 33887) by debbugs.gnu.org; 22 May 2019 16:02:12 +0000 Received: from localhost ([127.0.0.1]:42752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTTgy-0007st-8I for submit@debbugs.gnu.org; Wed, 22 May 2019 12:02:12 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTTgu-0007sa-P0 for 33887@debbugs.gnu.org; Wed, 22 May 2019 12:02:10 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2073980BAF; Wed, 22 May 2019 12:02:03 -0400 (EDT) Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D60508042C; Wed, 22 May 2019 12:02:01 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1558540921; bh=dE55UmkPDU+oj2LciPD3jkYBKawBrjUq583DMRWYKwE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Y5dL54x1KD2zYABgj4/z1VpLZw2pB6UBVZeB7xO5adalnHPst2MY9m4cvfIytg1ZU p9nh87bwihvWIDGp/jHy5wYxwQ2nWWL6G0qR9YoRWeKcvTC4+rMLib/lcGYeSyf0XA 1KeZv1mhlG/Yk7nJPNaKFqh1PeGpd9X8sMyCk+mbKu2UuHJms1cFQGG77qUsHXxy3H aWpqcp7iywl0LYMa/yKSpqQXD6Oa3acTeHU+ipKGpxbUWU1WC6QMVokE9YMBQYskh6 EUz5MqTv3ltqWVhvXhl6wXxTZdk8kEpvltgrc6J/cL3pv/GUe01JkW+lwwjYQ0krDE OL+ewrkawfEKw== Received: from alfajor (unknown [216.154.3.168]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id 0468E1206B4; Wed, 22 May 2019 12:02:00 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> <20190521010600.GA23463@zira.vinc17.org> <87imu49ene.fsf@gmail.com> <20190522154411.GA15113@zira.vinc17.org> Date: Wed, 22 May 2019 12:01:51 -0400 In-Reply-To: <20190522154411.GA15113@zira.vinc17.org> (Vincent Lefevre's message of "Wed, 22 May 2019 17:44:11 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.124 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > I'm not sure what you mean by that, but the single quotes are not > the only issue. No but it introduces problems a lot more often. > In general, you don't know the quoting rules in a > text node used by the underlying language (if any), even if you > have only double quotes. For instance, a text node may contain C > or shell code, which can be: > > "a string with \"double quotes\"..." Of course. But to the extent that it doesn't break the rest of the SGML support, I think it was a pretty good tradeoff (and has arguably a more often beneficial than harmful effect). > And one does not expect this to be interpreted as two pairs of > double-quoted text ("a string with \" and "..."). In short, you > should leave text nodes with no specific highlighting, as this > was the case with Emacs 25. IIRC in Emacs-24 it was yet different. Basically, the focus should be to handle tags correctly and what happens in the regular text between tags is not nearly as important. Stefan From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2019 21:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Vincent Lefevre , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155856148331167 (code B ref 33887); Wed, 22 May 2019 21:45:01 +0000 Received: (at 33887) by debbugs.gnu.org; 22 May 2019 21:44:43 +0000 Received: from localhost ([127.0.0.1]:43197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTZ2Q-00086c-Nj for submit@debbugs.gnu.org; Wed, 22 May 2019 17:44:42 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47159) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTZ2O-00086M-Im for 33887@debbugs.gnu.org; Wed, 22 May 2019 17:44:41 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 25DCC81164; Wed, 22 May 2019 17:44:35 -0400 (EDT) Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 06792806B0; Wed, 22 May 2019 17:44:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1558561474; bh=XM5YKOSLjsHSMoT+YVpr/omRKLv8dSfyDtkG86z05CY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=VhBjYWiqWoEjXrPKlQyn46UmWhREs3/DZVwdh42yoH4otlUhvnIe+KCDwhh2RYOGn UfPOi5FqXHanAPLAPxpCt85SptqdQg2T8q7bos33tI0a4eRPMXfI4KknCM+tIcGpEx NerU3HS1W+XDgqCPNAOBwlw6jhP8us7GtwNK97v/3eRRInCldPEyMKw4dDfDoHvkZU Mdhgw5te7C0ajNDkChoBy/fU1DBl1My4JiQfMRiUJMD6KurGJrxizmdA2GzB/4VhW9 xG8bkOZVHrPUrvTIYFWrDKQ1hpeV9hzOHuWmPlUJVbOAVr3rgTRrNEwsR7JTcz/IzB IrHWez+R9hAow== Received: from alfajor (unknown [216.154.3.168]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id C134A12081C; Wed, 22 May 2019 17:44:33 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> Date: Wed, 22 May 2019 17:44:32 -0400 In-Reply-To: (Stefan Monnier's message of "Sun, 19 May 2019 15:24:22 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.067 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >> >1 > Oh, damn! Hmm... Maybe the best way to detect this is using `parse-partial-sexp` passing it a `targetdepth` of -1. The trick will be when/where to call it so it's cheap enough. Stefan From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2019 22:38:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Vincent Lefevre , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15585646763537 (code B ref 33887); Wed, 22 May 2019 22:38:04 +0000 Received: (at 33887) by debbugs.gnu.org; 22 May 2019 22:37:56 +0000 Received: from localhost ([127.0.0.1]:43293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTZrw-0000uy-1T for submit@debbugs.gnu.org; Wed, 22 May 2019 18:37:56 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hTZrs-0000uk-VB for 33887@debbugs.gnu.org; Wed, 22 May 2019 18:37:53 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2CA1781164; Wed, 22 May 2019 18:37:47 -0400 (EDT) Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 061E0806B0; Wed, 22 May 2019 18:37:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1558564666; bh=oBO3Z0o5t8bSjVLUEpX2rR5DrLMizTpoIlUnCJ1Q4RE=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Uw9YyVg9+gNfzWD1zd/f9++uk7gQs6gwAuiaETJrFkhyeUy/hlP64QXFysrGfoNnQ ua5IeL38CPC2SeKmIPShiViZeEOkhTayLjq8uBKNqWPBt3mWcMUnvEmn1QFDmQUOaq icWyMETnECkNwPPfFE72WI3Me3Zp8Z/yWv3NkhvQEDLouEzvuUtEG4/bO4Zu/LOrqL BsTfUhysVnf2nrNsqMt87Z7/CzLmRwOImcT7faI46ltWvlz84DMxAkVuzxP6vfScWC +Lk+YClSJ0sF020N6hM9xpG6IY25a6ixjCCM6L3rQ7nvWQYsluzokd8AIGQP+riZJZ rcblkMpoAtA5w== Received: from alfajor (unknown [216.154.3.168]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id C1421120171; Wed, 22 May 2019 18:37:45 -0400 (EDT) From: Stefan Monnier Message-ID: References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> Date: Wed, 22 May 2019 18:37:44 -0400 In-Reply-To: <87o93wam5s.fsf@gmail.com> (Noam Postavsky's message of "Mon, 20 May 2019 16:47:11 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.062 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Right, this is due to chunking by syntax-propertize. Here's the fix: I pushed a patch which should fix the "lone >" problem without introducing any undue extra cost. It should also fix the "very long line" case. Stefan From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 May 2019 22:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Vincent Lefevre , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155890908727626 (code B ref 33887); Sun, 26 May 2019 22:19:01 +0000 Received: (at 33887) by debbugs.gnu.org; 26 May 2019 22:18:07 +0000 Received: from localhost ([127.0.0.1]:52041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hV1Sx-0007BW-7I for submit@debbugs.gnu.org; Sun, 26 May 2019 18:18:07 -0400 Received: from mail-it1-f179.google.com ([209.85.166.179]:54945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hV1Sv-0007B0-0Z for 33887@debbugs.gnu.org; Sun, 26 May 2019 18:18:05 -0400 Received: by mail-it1-f179.google.com with SMTP id h20so24073013itk.4 for <33887@debbugs.gnu.org>; Sun, 26 May 2019 15:18:04 -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=ELP+WO8JS6VFOi9PfvStfRHjuBlJ9TqymZaZS8x0RLw=; b=IaYsziczo0ieGmxqWuXU2U4FMZ6J9WLIkqGriBtSbqUh8SBuOQUiIIvZ5eAmjxZhWy ibq7HS8RnzGnOps2lJiB5LvUUUNgA7WkCZIMO9vIHnEv/qBPuLR1H9myJA48mou+SsrI EJo9hrI7EkKV9KPtCpTDi9WvCmeRT+HzG1TUa+z+m4JhBy8qQ2Fdz8WvSrPM5JNCUF/v spGYK/VKE6na+p57v6AvRCHOwuDNaVUH+MQzKp1kMpxel3IOxmj9ecfmneYlrkG9AXVX qRYFEmXYV2tMRhrJI/AW0JFCDvlT46mPfwm4a2bXqFipOP4W/+btmX0qFDHf9gwuBvr+ M4zg== 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=ELP+WO8JS6VFOi9PfvStfRHjuBlJ9TqymZaZS8x0RLw=; b=KFjQHuplvYaLLg16cQv78l3DjLX21lR40KKq268YD4WdTTHGwS2gz+DtS5IM40bPdX PkL8f7mCMHkoMnXNjX1pwTmW1M4mLYoJ+Xg/Brb4B7WEgwyAd8vNrHd9qlnD8ueW7msg lufHgp7k1C7B3xuTJZppco03babsMMH/nz6Dh40cIn0gRG7+D7cayuBQ/nR6fXnJjzzS YDZRzV0YTJXm71C46Wde8m7zJ6pY+kfzVz9Lr/ChnC0Ml/5yTdyXN8C775nwqeOQ3Nge IU7f8ojP0biaRsUCAlD2F4OGAK+MohEAyvqOfZqQ+V9BuP8gUNI6UWocQQRdxi5jdUGY 6pcA== X-Gm-Message-State: APjAAAWvjcKhYLhC4A8dGfLFIIh+1PjoM4sYS3xKthU+POZChYRMXOS5 zFv2Uci1obliyIGEMVGRC11ESt19 X-Google-Smtp-Source: APXvYqwpG2bimueKVSEqDSlf3GHKBZxjHjqZbk0I7KBs4GZwpt3N6nv1cOGZOGgd7chvIfVtC4qdhg== X-Received: by 2002:a24:5c90:: with SMTP id q138mr12345868itb.96.1558909079267; Sun, 26 May 2019 15:17:59 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id q1sm1050017ios.86.2019.05.26.15.17.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 May 2019 15:17:58 -0700 (PDT) From: Noam Postavsky References: <87ftujuvkd.fsf@zira.vinc17.org> <878sv7ff6j.fsf@gmail.com> <87pnoiegsh.fsf@gmail.com> <20190517213602.GA11777@zira.vinc17.org> <875zq8e6tw.fsf@gmail.com> <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> Date: Sun, 26 May 2019 18:17:55 -0400 In-Reply-To: (Stefan Monnier's message of "Wed, 22 May 2019 18:37:44 -0400") Message-ID: <875zpw97xo.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Stefan Monnier writes: > I pushed a patch which should fix the "lone >" problem without > introducing any undue extra cost. It should also fix the "very long > line" case. Seems to pass my tests. Not sure if you missed the alternate fix I proposed in https://debbugs.gnu.org/33887#94 or not. It does have the disadvantage of leaving (car (syntax-ppss)) unreliable for any other code which uses it. Here's a patch against master that should cover the remaining cases Vincent raised: --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Fix-some-SGML-syntax-edge-cases-Bug-33887.patch Content-Description: patch >From 2ffdab0e86161396e3d2606949d1fcf93c58b592 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 26 May 2019 11:07:14 -0400 Subject: [PATCH 1/2] Fix some SGML syntax edge cases (Bug#33887) * lisp/textmodes/sgml-mode.el (sgml-syntax-propertize-rules): Handle single and double quotes symmetrically. Don't skip quoted comment enders. * test/lisp/textmodes/sgml-mode-tests.el (sgml-tests--quotes-syntax): Add more test cases. (sgml-mode-quote-in-long-text): New test. --- lisp/textmodes/sgml-mode.el | 5 +++- test/lisp/textmodes/sgml-mode-tests.el | 45 ++++++++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 75f20722b0..1df7e78afc 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -363,9 +363,12 @@ (eval-and-compile ;; the resulting number of calls to syntax-ppss made it too slow ;; (bug#33887), so we're now careful to leave alone any pair ;; of quotes that doesn't hold a < or > char, which is the vast majority. - ("\\(?:\\(?1:\"\\)[^\"<>]*\\|\\(?1:'\\)[^'\"<>]*\\)" + ("\\([\"']\\)[^\"'<>]*" (1 (if (eq (char-after) (char-after (match-beginning 0))) (forward-char 1) + ;; Avoid skipping comment ender. + (when (eq (char-after) ?>) + (skip-chars-backward "-")) ;; Be careful to call `syntax-ppss' on a position before the one ;; we're going to change, so as not to need to flush the data we ;; just computed. diff --git a/test/lisp/textmodes/sgml-mode-tests.el b/test/lisp/textmodes/sgml-mode-tests.el index 1b8965e344..34d26480a4 100644 --- a/test/lisp/textmodes/sgml-mode-tests.el +++ b/test/lisp/textmodes/sgml-mode-tests.el @@ -161,15 +161,46 @@ (ert-deftest sgml-quote-works () (should (string= "&&" (buffer-string)))))) (ert-deftest sgml-tests--quotes-syntax () + (dolist (str '("a\"b c'd" + "a'b c\"d" + "\"a'" + "'a\"" + "\"a'\"" + "'a\"'" + "a\"b c'd" + "c>'d" + "" + "" + )) + (with-temp-buffer + (sgml-mode) + (insert str) + (ert-info ((format "%S" str) :prefix "Test case: ") + ;; Check that last tag is parsed as a tag. + (should (= 1 (car (syntax-ppss (1- (point-max)))))) + (should (= 0 (car (syntax-ppss (point-max))))))))) + +(ert-deftest sgml-mode-quote-in-long-text () (with-temp-buffer (sgml-mode) - (insert "a\"b c'd") - (should (= 1 (car (syntax-ppss (1- (point-max)))))) - (should (= 0 (car (syntax-ppss (point-max))))) - (erase-buffer) - (insert "c>d") - (should (= 1 (car (syntax-ppss (1- (point-max)))))) - (should (= 0 (car (syntax-ppss (point-max))))))) + (insert "" + ;; `syntax-propertize-wholelines' extends chunk size based + ;; on line length, so newlines are significant! + (make-string syntax-propertize-chunk-size ?a) "\n" + "'" + (make-string syntax-propertize-chunk-size ?a) "\n" + "") + ;; If we just check (syntax-ppss (point-max)) immediately, then + ;; we'll end up propertizing the whole buffer in one chunk (so the + ;; test is useless). Simulate something more like what happens + ;; when the buffer is viewed normally. + (cl-loop for pos from (point-min) to (point-max) + by syntax-propertize-chunk-size + do (syntax-ppss pos)) + (syntax-ppss (point-max)) + ;; Check that last tag is parsed as a tag. + (should (= 1 (- (car (syntax-ppss (1- (point-max)))) + (car (syntax-ppss (point-max)))))))) (provide 'sgml-mode-tests) ;;; sgml-mode-tests.el ends here -- 2.11.0 --=-=-= Content-Type: text/plain And about the highlighting of quoted text outside tags, we can just disable fontification, while leaving the syntax code untouched: --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0002-Don-t-fontiy-text-outside-of-SGML-XML-tags-Bug-33887.patch Content-Description: patch >From a4a6008d96011e2517939cb8cb51624802a8c31e Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 26 May 2019 17:41:22 -0400 Subject: [PATCH 2/2] Don't fontiy text outside of SGML/XML tags (Bug#33887) * lisp/font-lock.el (font-lock-syntactic-face-function-default): New function. (font-lock-syntactic-face-function): Use it as default value. * lisp/textmodes/sgml-mode.el (sgml-font-lock-syntactic-face): New function. (sgml-mode): * lisp/nxml/nxml-mode.el (nxml-mode): Use it as font-lock-syntactic-face-function value. --- lisp/font-lock.el | 7 +++++-- lisp/nxml/nxml-mode.el | 4 +++- lisp/textmodes/sgml-mode.el | 11 +++++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 3991a4ee8e..ddf1cbdb9f 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -527,9 +527,12 @@ (defvar font-lock-syntactically-fontified 0 sometimes be slightly incorrect.") (make-variable-buffer-local 'font-lock-syntactically-fontified) +(defun font-lock-syntactic-face-function-default (state) + "Default value for `font-lock-syntactic-face-function'." + (if (nth 3 state) font-lock-string-face font-lock-comment-face)) + (defvar font-lock-syntactic-face-function - (lambda (state) - (if (nth 3 state) font-lock-string-face font-lock-comment-face)) + #'font-lock-syntactic-face-function-default "Function to determine which face to use when fontifying syntactically. The function is called with a single parameter (the state as returned by `parse-partial-sexp' at the beginning of the region to highlight) and diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index da01b2a342..05044d66df 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -551,7 +551,9 @@ (define-derived-mode nxml-mode text-mode "nXML" nil ; no special syntax table (font-lock-extend-region-functions . (nxml-extend-region)) (jit-lock-contextually . t) - (font-lock-unfontify-region-function . nxml-unfontify-region))) + (font-lock-unfontify-region-function . nxml-unfontify-region) + (font-lock-syntactic-face-function + . sgml-font-lock-syntactic-face))) (with-demoted-errors (rng-nxml-mode-init))) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 1df7e78afc..225fe72a01 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -329,6 +329,11 @@ (defconst sgml-font-lock-keywords-2 (defvar sgml-font-lock-keywords sgml-font-lock-keywords-1 "Rules for highlighting SGML code. See also `sgml-tag-face-alist'.") +(defun sgml-font-lock-syntactic-face (state) + "`font-lock-syntactic-face-function' for `sgml-mode'." + (and (nth 9 state) ;; Only use faces within tags. + (font-lock-syntactic-face-function-default state))) + (defvar-local sgml--syntax-propertize-ppss nil) (defun sgml--syntax-propertize-ppss (pos) @@ -573,7 +578,7 @@ (define-derived-mode sgml-mode text-mode '(sgml-xml-mode "XML" "SGML") ;; This is desirable because SGML discards a newline that appears ;; immediately after a start tag or immediately before an end tag. (setq-local paragraph-start (concat "[ \t]*$\\|\ -[ \t]*")) +\[ \t]*")) (setq-local paragraph-separate (concat paragraph-start "$")) (setq-local adaptive-fill-regexp "[ \t]*") (add-hook 'fill-nobreak-predicate 'sgml-fill-nobreak nil t) @@ -591,7 +596,9 @@ (define-derived-mode sgml-mode text-mode '(sgml-xml-mode "XML" "SGML") (setq font-lock-defaults '((sgml-font-lock-keywords sgml-font-lock-keywords-1 sgml-font-lock-keywords-2) - nil t)) + nil t nil + (font-lock-syntactic-face-function + . sgml-font-lock-syntactic-face))) (setq-local syntax-propertize-function #'sgml-syntax-propertize) (setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function) (setq-local sgml-xml-mode (sgml-xml-guess)) -- 2.11.0 --=-=-=-- From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 May 2019 09:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15589487372025 (code B ref 33887); Mon, 27 May 2019 09:19:01 +0000 Received: (at 33887) by debbugs.gnu.org; 27 May 2019 09:18:57 +0000 Received: from localhost ([127.0.0.1]:52628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVBmS-0000Wb-Mj for submit@debbugs.gnu.org; Mon, 27 May 2019 05:18:56 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:41150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVBmR-0000WQ-2w for 33887@debbugs.gnu.org; Mon, 27 May 2019 05:18:56 -0400 Received: from smtp-zira.vinc17.net (2a02-8429-80cd-3101-328d-99ff-fe25-ad3f.rev.sfr.net [IPv6:2a02:8429:80cd:3101:328d:99ff:fe25:ad3f]) by joooj.vinc17.net (Postfix) with ESMTPSA id 24BA02A1; Mon, 27 May 2019 11:18:51 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id BA485C209F9; Mon, 27 May 2019 11:18:50 +0200 (CEST) Date: Mon, 27 May 2019 11:18:50 +0200 From: Vincent Lefevre Message-ID: <20190527091850.GA5676@zira.vinc17.org> References: <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> <875zpw97xo.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <875zpw97xo.fsf@gmail.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.12+5 (cd30526c) vl-117499 (2019-05-26) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2019-05-26 18:17:55 -0400, Noam Postavsky wrote: > And about the highlighting of quoted text outside tags, we can just > disable fontification, while leaving the syntax code untouched: [...] I've applied it with a minor change against Emacs 26 (context lines for hunk #1 of sgml-mode.el are different), but the comments are no longer highlighted as comments. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 May 2019 12:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.15589585504826 (code B ref 33887); Mon, 27 May 2019 12:03:01 +0000 Received: (at 33887) by debbugs.gnu.org; 27 May 2019 12:02:30 +0000 Received: from localhost ([127.0.0.1]:52874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVEKk-0001Fm-12 for submit@debbugs.gnu.org; Mon, 27 May 2019 08:02:30 -0400 Received: from mail-io1-f46.google.com ([209.85.166.46]:40463) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVEKh-0001FZ-Jx for 33887@debbugs.gnu.org; Mon, 27 May 2019 08:02:28 -0400 Received: by mail-io1-f46.google.com with SMTP id n5so6868886ioc.7 for <33887@debbugs.gnu.org>; Mon, 27 May 2019 05:02:27 -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=1ewxJ/0DtouASLVd+tHMQykYrLBZ3eOgpeBnvdaFGlw=; b=QShLdIdnDwmdzlviBh/glnYhkm+0D+SHxaEP8GBn61XDF4nTly3elrecvedQRQHCia U587mrBxm6Y4E4tf+LK7Mlc72pCirdDhM0Zew6jZTxigYFSOhJ6zeOH+wBnI8EJJ8eNJ uXsVRmXJXd7nT4D61TxdIFhxhqNB8g7DIgXmDmznVs2JV5ubt6Kk8JRvUSZjnyMBOOAc lUeNfFrN+yyzpkJTUm4dgbJmFoETF7wOr3XsVg7jQVEH5o2Skc1F32++XWHzBWtZtviE OT4/LFPr0TIKiaudEY+zM9H0TkyTvL/DQtEHDhI//MQRCFF3ENpZdPGqbDID6hWgeAcF dHpA== 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=1ewxJ/0DtouASLVd+tHMQykYrLBZ3eOgpeBnvdaFGlw=; b=U+oEL/Isa8qzHDzBh1Wrq8cMvxo9OUvy8eq6j2ysT6DGeqqG64VXbAswf7iMt0/kBD M16i3//lfYMM9JRHwymFjPO0ktsHAKGOLrxgTNlWZ6biA/3jmL5FTosIYWPPHCwet1Yg GRGYckQqO9U64Sx++vwQrZDMKxLQoqENQu+GZgl2Ubw5f+/e6ZYb0pGgEoVYLyZiY0IE ydH5Ev5IEE7kyLwnAKV6S5HOq+5aynLxyGThSvmZvRvoZvvXX4jkWQt9xhZKQbddEeEI F147AQ7hnCysxZRd4pyGLDY8VpHM07SVTuO+QK27PsGRSiDq/YqU6etlYl5h49uDJozr +DEQ== X-Gm-Message-State: APjAAAV1YBWLGc6lLI50/8ZKTv6uukyjQe3gcSODnq2Br/hzQLAviB2C vHG0sRP3Cec6Fo9X4mve3+ZBKJp3 X-Google-Smtp-Source: APXvYqxNXSRGA3UAty2YlPrBOtKXv0/qKOU7UWOERdKSzhjjT5dXeROwAyqToEmrWVBZ6LsydMWOWQ== X-Received: by 2002:a5d:9306:: with SMTP id l6mr18876863ion.168.1558958541772; Mon, 27 May 2019 05:02:21 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id a2sm3427256iok.47.2019.05.27.05.02.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 May 2019 05:02:20 -0700 (PDT) From: Noam Postavsky References: <20190518144756.GA21327@zira.vinc17.org> <87r28vd2d5.fsf@gmail.com> <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> <875zpw97xo.fsf@gmail.com> <20190527091850.GA5676@zira.vinc17.org> Date: Mon, 27 May 2019 08:02:18 -0400 In-Reply-To: <20190527091850.GA5676@zira.vinc17.org> (Vincent Lefevre's message of "Mon, 27 May 2019 11:18:50 +0200") Message-ID: <87y32s6r79.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Vincent Lefevre writes: > On 2019-05-26 18:17:55 -0400, Noam Postavsky wrote: >> And about the highlighting of quoted text outside tags, we can just >> disable fontification, while leaving the syntax code untouched: > [...] > > I've applied it with a minor change against Emacs 26 (context lines > for hunk #1 of sgml-mode.el are different), but the comments are > no longer highlighted as comments. Ah, I guess reusing the default font-lock-syntactic-face-function doesn't really make sense after all. So sgml-font-lock-syntactic-face should be like this: (defun sgml-font-lock-syntactic-face (state) "`font-lock-syntactic-face-function' for `sgml-mode'." ;; Don't use string face outside of tags. (cond ((and (nth 9 state) (nth 3 state)) font-lock-string-face) ((nth 4 state) font-lock-comment-face))) --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-Don-t-fontify-text-outside-of-SGML-XML-tags-Bug-3388.patch Content-Description: patch >From 0c3e6a97f92dec31e7e186dae933c86700034089 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 26 May 2019 17:41:22 -0400 Subject: [PATCH] Don't fontify text outside of SGML/XML tags (Bug#33887) * lisp/font-lock.el (font-lock-syntactic-face-function-default): New function. (font-lock-syntactic-face-function): Use it as default value. * lisp/textmodes/sgml-mode.el (sgml-font-lock-syntactic-face): New function. (sgml-mode): * lisp/nxml/nxml-mode.el (nxml-mode): Use it as font-lock-syntactic-face-function value. --- lisp/font-lock.el | 7 +++++-- lisp/nxml/nxml-mode.el | 4 +++- lisp/textmodes/sgml-mode.el | 12 ++++++++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 3991a4ee8e..ddf1cbdb9f 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -527,9 +527,12 @@ (defvar font-lock-syntactically-fontified 0 sometimes be slightly incorrect.") (make-variable-buffer-local 'font-lock-syntactically-fontified) +(defun font-lock-syntactic-face-function-default (state) + "Default value for `font-lock-syntactic-face-function'." + (if (nth 3 state) font-lock-string-face font-lock-comment-face)) + (defvar font-lock-syntactic-face-function - (lambda (state) - (if (nth 3 state) font-lock-string-face font-lock-comment-face)) + #'font-lock-syntactic-face-function-default "Function to determine which face to use when fontifying syntactically. The function is called with a single parameter (the state as returned by `parse-partial-sexp' at the beginning of the region to highlight) and diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index da01b2a342..05044d66df 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -551,7 +551,9 @@ (define-derived-mode nxml-mode text-mode "nXML" nil ; no special syntax table (font-lock-extend-region-functions . (nxml-extend-region)) (jit-lock-contextually . t) - (font-lock-unfontify-region-function . nxml-unfontify-region))) + (font-lock-unfontify-region-function . nxml-unfontify-region) + (font-lock-syntactic-face-function + . sgml-font-lock-syntactic-face))) (with-demoted-errors (rng-nxml-mode-init))) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 1df7e78afc..da25665e62 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -329,6 +329,12 @@ (defconst sgml-font-lock-keywords-2 (defvar sgml-font-lock-keywords sgml-font-lock-keywords-1 "Rules for highlighting SGML code. See also `sgml-tag-face-alist'.") +(defun sgml-font-lock-syntactic-face (state) + "`font-lock-syntactic-face-function' for `sgml-mode'." + ;; Don't use string face outside of tags. + (cond ((and (nth 9 state) (nth 3 state)) font-lock-string-face) + ((nth 4 state) font-lock-comment-face))) + (defvar-local sgml--syntax-propertize-ppss nil) (defun sgml--syntax-propertize-ppss (pos) @@ -573,7 +579,7 @@ (define-derived-mode sgml-mode text-mode '(sgml-xml-mode "XML" "SGML") ;; This is desirable because SGML discards a newline that appears ;; immediately after a start tag or immediately before an end tag. (setq-local paragraph-start (concat "[ \t]*$\\|\ -[ \t]*")) +\[ \t]*")) (setq-local paragraph-separate (concat paragraph-start "$")) (setq-local adaptive-fill-regexp "[ \t]*") (add-hook 'fill-nobreak-predicate 'sgml-fill-nobreak nil t) @@ -591,7 +597,9 @@ (define-derived-mode sgml-mode text-mode '(sgml-xml-mode "XML" "SGML") (setq font-lock-defaults '((sgml-font-lock-keywords sgml-font-lock-keywords-1 sgml-font-lock-keywords-2) - nil t)) + nil t nil + (font-lock-syntactic-face-function + . sgml-font-lock-syntactic-face))) (setq-local syntax-propertize-function #'sgml-syntax-propertize) (setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function) (setq-local sgml-xml-mode (sgml-xml-guess)) -- 2.11.0 --=-=-=-- From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Vincent Lefevre Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 May 2019 00:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Noam Postavsky Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155908983322865 (code B ref 33887); Wed, 29 May 2019 00:31:01 +0000 Received: (at 33887) by debbugs.gnu.org; 29 May 2019 00:30:33 +0000 Received: from localhost ([127.0.0.1]:57717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVmUD-0005wi-4h for submit@debbugs.gnu.org; Tue, 28 May 2019 20:30:33 -0400 Received: from joooj.vinc17.net ([155.133.131.76]:42174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVmUA-0005wX-GL for 33887@debbugs.gnu.org; Tue, 28 May 2019 20:30:31 -0400 Received: from smtp-zira.vinc17.net (2a02-8429-80cd-3101-328d-99ff-fe25-ad3f.rev.sfr.net [IPv6:2a02:8429:80cd:3101:328d:99ff:fe25:ad3f]) by joooj.vinc17.net (Postfix) with ESMTPSA id 3ACEE23C; Wed, 29 May 2019 02:30:27 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id DF4EDC215C8; Wed, 29 May 2019 02:30:25 +0200 (CEST) Date: Wed, 29 May 2019 02:30:25 +0200 From: Vincent Lefevre Message-ID: <20190529003025.GA3336@zira.vinc17.org> References: <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> <875zpw97xo.fsf@gmail.com> <20190527091850.GA5676@zira.vinc17.org> <87y32s6r79.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87y32s6r79.fsf@gmail.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.12+5 (cd30526c) vl-117499 (2019-05-26) X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thanks. A last issue: a comment before the root element is not highlighted. Example: in the first comment is not highlighted, but the other two comments are. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) From unknown Sun Jun 22 04:17:56 2025 X-Loop: help-debbugs@gnu.org Subject: bug#33887: 26.1; Emacs hangs for several seconds when going to the end of an XML file in nXML mode Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Jun 2019 12:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33887 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Vincent Lefevre Cc: Stefan Monnier , 33887@debbugs.gnu.org Received: via spool by 33887-submit@debbugs.gnu.org id=B33887.155965296211414 (code B ref 33887); Tue, 04 Jun 2019 12:57:02 +0000 Received: (at 33887) by debbugs.gnu.org; 4 Jun 2019 12:56:02 +0000 Received: from localhost ([127.0.0.1]:44213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hY8yv-0002xv-Kf for submit@debbugs.gnu.org; Tue, 04 Jun 2019 08:56:02 -0400 Received: from mail-it1-f196.google.com ([209.85.166.196]:54909) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hY8ys-0002xW-WD; Tue, 04 Jun 2019 08:55:59 -0400 Received: by mail-it1-f196.google.com with SMTP id h20so33163735itk.4; Tue, 04 Jun 2019 05:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=aaRCoZ9RW3LAPjAr9Cymt8PKxz4h/1A6Rs7wbxxVS4o=; b=FE0yryZMNwKRDZrZA+ltAqR1bpk251VvLuzeyV6gFSQflBAHVYOeCrDbUqudABfhQq SPuwj3UN09MJeIlQicrif3Fa3u376LyiHUIVPWB9aIxdszFtD1MjoOeVkO2IM5+us3Hz YM10dO6yEAj5cCQck7B/ATxKxg2YFkGQ07DXcOx3YQiAbOpWgE03NNHsBV14KG3caFtH VltJtYwWTFYvGS8jgpmoR9kra7Dgc5QZDxlCEbuS1IuDjWUGpazhVrxftG2dCqgdyvbZ Hixr4gumdxtEXNvO6DryvbS0cXb2yILLq65ajqXNWcdQkMdoFMH5ivcM4DntsNBPHJHG fLGw== 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:in-reply-to:references :user-agent:date:message-id:mime-version; bh=aaRCoZ9RW3LAPjAr9Cymt8PKxz4h/1A6Rs7wbxxVS4o=; b=QbLVWv/F3l90FZfn9l9uIUZam7EijD35zRqWLsQI4gmRJqgahqL3V5X4UMlAQh3pZu TinAr4XNIyV4aTkxB2/A+zidh/UMmZl6gIKkYWFPB0tcu/UZQL4XmEKHFnl+EWnMksP2 E6gcVpUaVC+xJ1WasOJ3kVhU0ZJ74fLfNdlMV39g53qxRelFkUHHU+7kG9C8AcEcHEUU A1DvxoVm5Nhh2SjwV4wj/ogxN5hZybo+0+IUpFdP5lM8XtK7YEm+qBzU7u+Rk36V6KjM XSlYw6xcEMZl9yd4xf5jLFJeTck33n76XKFVM46LYd5uEbujEtX7C1OrBwP5YrxbIq1q 6wtw== X-Gm-Message-State: APjAAAUjypes4xkHbeWQ9BrbGoqtj1x8ygzxS99/fKSOcaAmrK6zg0aj kj0mDTAAR45JRQFQVXN9sD0HzWrd X-Google-Smtp-Source: APXvYqxKT8Hug+Un0w++SFLy4LsjcPHiV948LV7uD8WHcaF3AbSGhQUTyocuCKCbdWGke+/QKESr+g== X-Received: by 2002:a24:6294:: with SMTP id d142mr21377749itc.102.1559652952961; Tue, 04 Jun 2019 05:55:52 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id x124sm2839970itb.3.2019.06.04.05.55.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Jun 2019 05:55:51 -0700 (PDT) From: Noam Postavsky In-Reply-To: <20190529003025.GA3336@zira.vinc17.org> (Vincent Lefevre's message of "Wed, 29 May 2019 02:30:25 +0200") References: <20190519001704.GA5467@zira.vinc17.org> <87k1embaqx.fsf@gmail.com> <87h89qb722.fsf@gmail.com> <87o93wam5s.fsf@gmail.com> <875zpw97xo.fsf@gmail.com> <20190527091850.GA5676@zira.vinc17.org> <87y32s6r79.fsf@gmail.com> <20190529003025.GA3336@zira.vinc17.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Date: Tue, 04 Jun 2019 08:55:50 -0400 Message-ID: <87ftop4ii1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) tags 33887 fixed close 33887 27.1 quit Vincent Lefevre writes: > Thanks. A last issue: a comment before the root element is not > highlighted. Example: in > > > > > > > > > the first comment is not highlighted, but the other two comments are. This was followed up in https://debbugs.gnu.org/32823#45 I'm pushing the current patches to master and closing this bug, as I think all the issues here are resolved (if not, we can open new bugs). e04f93e18a 2019-06-04T08:42:50-04:00 "Don't fontify text outside of SGML/XML tags (Bug#33887)" https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e04f93e18a8083d3a4930decc523c4f5d9a97c9e 438e4804d1 2019-06-04T08:42:50-04:00 "Fix some SGML syntax edge cases (Bug#33887)" https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=438e4804d107720f526d0c7c367cbd029f264676