-(defun fast-lock-set-face-properties (properties)
- "Set all `face' text properties to PROPERTIES in the current buffer.
-Any existing `face' text properties are removed first.
-See `fast-lock-get-face-properties' for the format of PROPERTIES."
+(defun fast-lock-get-syntactic-properties ()
+ "Return a list of `syntax-table' text properties in the current buffer.
+See `fast-lock-get-face-properties'."
+ (save-restriction
+ (widen)
+ (let ((start (text-property-not-all (point-min) (point-max) 'syntax-table
+ nil))
+ end properties value cell)
+ (while start
+ (setq end (next-single-property-change start 'syntax-table nil
+ (point-max))
+ value (get-text-property start 'syntax-table))
+ ;; Make, or add to existing, list of regions with same `syntax-table'.
+ (if (setq cell (assoc value properties))
+ (setcdr cell (cons start (cons end (cdr cell))))
+ (push (list value start end) properties))
+ (setq start (text-property-not-all end (point-max) 'syntax-table nil)))
+ properties)))
+
+(defun fast-lock-add-properties (syntactic-properties face-properties)
+ "Add `syntax-table' and `face' text properties to the current buffer.
+Any existing `syntax-table' and `face' text properties are removed first.
+See `fast-lock-get-face-properties'."