Function: fast-lock-add-properties

fast-lock-add-properties is a byte-compiled function defined in fast-lock.el.gz.

Signature

(fast-lock-add-properties SYNTACTIC-PROPERTIES FACE-PROPERTIES)

Documentation

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.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/fast-lock.el.gz
(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'."
  (with-silent-modifications
    (let ((inhibit-point-motion-hooks t))
      (save-restriction
        (widen)
        (font-lock-unfontify-region (point-min) (point-max))
        ;;
        ;; Set the `syntax-table' property for each start/end region.
        (pcase-dolist (`(,plist . ,regions) syntactic-properties)
	  (while regions
	    (add-text-properties (nth 0 regions) (nth 1 regions) plist)
	    (setq regions (nthcdr 2 regions))))
	;;
	;; Set the `face' property for each start/end region.
        (pcase-dolist (`(,plist . ,regions) face-properties)
	  (while regions
	    (add-text-properties (nth 0 regions) (nth 1 regions) plist)
	    (setq regions (nthcdr 2 regions))))))))