From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: nxml maintainer? Date: Fri, 10 May 2013 13:25:39 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1368206760 13626 80.91.229.3 (10 May 2013 17:26:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 May 2013 17:26:00 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 10 19:25:57 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Uar4u-0005Dl-0r for ged-emacs-devel@m.gmane.org; Fri, 10 May 2013 19:25:56 +0200 Original-Received: from localhost ([::1]:53327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uar4t-0007Cy-Hp for ged-emacs-devel@m.gmane.org; Fri, 10 May 2013 13:25:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uar4h-00079Z-IC for emacs-devel@gnu.org; Fri, 10 May 2013 13:25:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uar4f-00068M-0e for emacs-devel@gnu.org; Fri, 10 May 2013 13:25:43 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:57165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uar4e-00068G-N8 for emacs-devel@gnu.org; Fri, 10 May 2013 13:25:40 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r4AHPdmN025458; Fri, 10 May 2013 13:25:39 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 29B2CB4161; Fri, 10 May 2013 13:25:39 -0400 (EDT) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4575=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4575> : streams <958088> : uri <1416740> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:159487 Archived-At: I'd like to install the patch below, which removes a "feature" which I find dubious: it's a lot of code just to provide a behavior which is not clearly superior. The behavior in question is to treat an unmatched is "somewhere after point-max". Stefan === modified file 'lisp/nxml/nxml-mode.el' --- lisp/nxml/nxml-mode.el 2013-03-23 02:21:25 +0000 +++ lisp/nxml/nxml-mode.el 2013-05-09 22:42:47 +0000 @@ -352,11 +352,6 @@ See the function `xmltok-forward-prolog' for more information.") (make-variable-buffer-local 'nxml-prolog-regions) -(defvar nxml-last-fontify-end nil - "Position where fontification last ended. -It is nil if the buffer changed since the last fontification.") -(make-variable-buffer-local 'nxml-last-fontify-end) - (defvar nxml-degraded nil "Non-nil if currently operating in degraded mode. Degraded mode is enabled when an internal error is encountered in the @@ -538,7 +533,6 @@ (save-excursion (save-restriction (widen) - (nxml-clear-dependent-regions (point-min) (point-max)) (setq nxml-scan-end (copy-marker (point-min) nil)) (with-silent-modifications (nxml-clear-inside (point-min) (point-max)) @@ -583,12 +577,9 @@ ;; Clean up fontification. (save-excursion (widen) - (let ((inhibit-read-only t) - (buffer-undo-list t) - (modified (buffer-modified-p))) + (with-silent-modifications (nxml-with-invisible-motion - (remove-text-properties (point-min) (point-max) '(face))) - (set-buffer-modified-p modified))) + (remove-text-properties (point-min) (point-max) '(face))))) (remove-hook 'change-major-mode-hook 'nxml-cleanup t)) (defun nxml-degrade (context err) @@ -638,10 +629,6 @@ For bookkeeping, call this function even when fontification is disabled." (let ((pre-change-end (+ start pre-change-length))) - (setq start - (nxml-adjust-start-for-dependent-regions start - end - pre-change-length)) ;; If the prolog might have changed, rescan the prolog (when (<= start ;; Add 2 so as to include the < and following char that @@ -902,8 +889,7 @@ (defun nxml-extend-after-change-region (start end pre-change-length) (unless nxml-degraded - (setq nxml-last-fontify-end nil) - (let ((region (nxml-with-degradation-on-error + (nxml-with-degradation-on-error 'nxml-extend-after-change-region (save-excursion (save-restriction @@ -911,17 +897,8 @@ (save-match-data (nxml-with-invisible-motion (with-silent-modifications - (nxml-extend-after-change-region1 + (nxml-after-change1 start end pre-change-length))))))))) - (if (consp region) region)))) - -(defun nxml-extend-after-change-region1 (start end pre-change-length) - (let* ((region (nxml-after-change1 start end pre-change-length)) - (font-lock-beg (car region)) - (font-lock-end (cdr region))) - - (nxml-extend-region) - (cons font-lock-beg font-lock-end))) (defun nxml-fontify-matcher (bound) "Called as font-lock keyword matcher." @@ -936,13 +913,12 @@ (nxml-fontify-prolog) (goto-char nxml-prolog-end)) - (let (xmltok-dependent-regions - xmltok-errors) + (let (xmltok-errors) (while (and (nxml-tokenize-forward) (<= (point) bound)) ; Intervals are open-ended. (nxml-apply-fontify-rule))) - (setq nxml-last-fontify-end (point))) + ) ;; Since we did the fontification internally, tell font-lock to not ;; do anything itself. === modified file 'lisp/nxml/nxml-rap.el' --- lisp/nxml/nxml-rap.el 2013-03-23 02:21:25 +0000 +++ lisp/nxml/nxml-rap.el 2013-05-09 22:37:06 +0000 @@ -69,18 +69,6 @@ ;; typical proportion of comments, CDATA sections and processing ;; instructions is small relative to other things. Secondly, to scan ;; we just search for the regexp <[!?]. -;; -;; One problem is unclosed comments, processing instructions and CDATA -;; sections. Suppose, for example, we encounter a . This is not an unexpected situation if the user is -;; creating a comment. It is not helpful to treat the whole of the -;; file starting from the gets added to the buffer after the unclosed ") - (xmltok-add-dependent 'xmltok-unclosed-reparse-p - nil - nil - ;; not --> because - ;; -- is not allowed - ;; in comments in XML - "--") - 'not-well-formed) - ((eq (char-after) ?>) + (cond ((or (eq (char-after) ?>) (not found--)) (goto-char (1+ (point))) 'comment) (t - (xmltok-add-dependent - 'xmltok-semi-closed-reparse-p - nil - (point) - "--" - 2) ;; just include the