* lisp/nxml/nxml-mode.el (nxml-extend-region):
Protect against error "Invalid search bound (wrong side of point)".
* lisp/vc/diff-mode.el (diff-syntax-fontify-hunk):
Use 'with-demoted-errors' instead of 'ignore-errors'.
(cherry picked from commit
ddc7bd547a2b422c4b8dca30076c0d9b70de09ad)
(skip-syntax-forward " ")
;; find the beginning of the previous tag
- (when (not (equal (char-after) ?\<))
+ (when (and (not (equal (char-after) ?\<))
+ (< nxml-prolog-end (point)))
(search-backward "<" nxml-prolog-end t))
(nxml-ensure-scan-up-to-date)
(nxml-move-outside-backwards)
((memq diff-font-lock-syntax '(hunk-also hunk-only))
(with-temp-buffer
(insert text)
- ;; Enabling a major mode on a single hunk without
- ;; sufficient context often raises many errors such as
- ;; "Premature end of data", "Invalid search bound", etc.
- ;; So need to ignore all these errors.
- (ignore-errors
+ (with-demoted-errors "%S"
(diff-syntax-fontify-props file text line-nb t)))))))))
;; Put properties over the hunk text