- ;; save-buffer-state is a macro in font-lock.el!
- (save-buffer-state nil
- (when (boundp 'font-lock-syntactic-keywords)
- (remove-text-properties beg end '(syntax-table nil)))
- ;; instead of just using (remove-text-properties beg end '(face
- ;; nil)), we find regions with a non-nil face test-property, skip
- ;; positions with the ansi-color property set, and remove the
- ;; remaining face test-properties.
- (while (setq beg (text-property-not-all beg end 'face nil))
- (setq beg (or (text-property-not-all beg end 'ansi-color t) end))
- (when (get-text-property beg 'face)
- (let ((end-face (or (text-property-any beg end 'face nil)
- end)))
- (remove-text-properties beg end-face '(face nil))
- (setq beg end-face))))))
+ ;; Simplified now that font-lock-unfontify-region uses save-buffer-state.
+ (when (boundp 'font-lock-syntactic-keywords)
+ (remove-text-properties beg end '(syntax-table nil)))
+ ;; instead of just using (remove-text-properties beg end '(face
+ ;; nil)), we find regions with a non-nil face test-property, skip
+ ;; positions with the ansi-color property set, and remove the
+ ;; remaining face test-properties.
+ (while (setq beg (text-property-not-all beg end 'face nil))
+ (setq beg (or (text-property-not-all beg end 'ansi-color t) end))
+ (when (get-text-property beg 'face)
+ (let ((end-face (or (text-property-any beg end 'face nil)
+ end)))
+ (remove-text-properties beg end-face '(face nil))
+ (setq beg end-face)))))