From c99904740ebcfde5533c29798618b968d56c0bf4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 15 May 2013 14:31:51 -0400 Subject: [PATCH] * lisp/nxml/nxml-mode.el: Treat unclosed <[[, + + * nxml/nxml-mode.el: Treat unclosed <[[, - * progmodes/octave.el (octave-goto-function-definition): Improve - and fix callers. + * progmodes/octave.el (octave-goto-function-definition): + Improve and fix callers. 2013-05-15 Stefan Monnier @@ -277,7 +304,8 @@ their declaration. (vhdl-mode-syntax-table-init): Remove. - * progmodes/m4-mode.el (m4-mode-syntax-table): Add comment on last change. + * progmodes/m4-mode.el (m4-mode-syntax-table): Add comment on + last change. * progmodes/ld-script.el (ld-script-mode-syntax-table): Use symbol syntax for "_". @@ -292,7 +320,8 @@ Handle a _ with symbol syntax. (autoconf-mode): Don't change the syntax-table for imenu and font-lock. - * progmodes/ada-mode.el (ada-mode-abbrev-table): Consolidate declaration. + * progmodes/ada-mode.el (ada-mode-abbrev-table): + Consolidate declaration. (ada-mode-syntax-table, ada-mode-symbol-syntax-table): Initialize in the declaration. (ada-create-syntax-table): Remove. diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el index 44271a689c..c45196f031 100644 --- a/lisp/nxml/nxml-mode.el +++ b/lisp/nxml/nxml-mode.el @@ -352,11 +352,6 @@ Use `nxml-parent-document-set' to set it.") 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 @@ Many aspects this mode can be customized using (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 @@ Many aspects this mode can be customized using ;; 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 @@ the full extent of the area needing refontification. 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,26 +889,16 @@ Called with `font-lock-beg' and `font-lock-end' dynamically bound." (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-extend-after-change-region - (save-excursion - (save-restriction - (widen) - (save-match-data - (nxml-with-invisible-motion - (with-silent-modifications - (nxml-extend-after-change-region1 - 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))) + (nxml-with-degradation-on-error + 'nxml-extend-after-change-region + (save-excursion + (save-restriction + (widen) + (save-match-data + (nxml-with-invisible-motion + (with-silent-modifications + (nxml-after-change1 + start end pre-change-length))))))))) (defun nxml-fontify-matcher (bound) "Called as font-lock keyword matcher." @@ -936,13 +913,12 @@ Called with `font-lock-beg' and `font-lock-end' dynamically bound." (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. diff --git a/lisp/nxml/nxml-rap.el b/lisp/nxml/nxml-rap.el index 5bc4d74456..ac4e9ac4cd 100644 --- a/lisp/nxml/nxml-rap.el +++ b/lisp/nxml/nxml-rap.el @@ -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) ?>) - (goto-char (1+ (point))) - 'comment) - (t - (xmltok-add-dependent - 'xmltok-semi-closed-reparse-p - nil - (point) - "--" - 2) - ;; just include the