Function: htmlize-copy-attr-if-set

htmlize-copy-attr-if-set is a macro defined in htmlize.el.

Signature

(htmlize-copy-attr-if-set ATTR-LIST DEST SOURCE)

Source Code

;; Defined in ~/.emacs.d/elpa/htmlize-20250724.1703/htmlize.el
(defmacro htmlize-copy-attr-if-set (attr-list dest source)
  ;; Generate code with the following pattern:
  ;; (progn
  ;;   (when (htmlize-fstruct-ATTR source)
  ;;     (setf (htmlize-fstruct-ATTR dest) (htmlize-fstruct-ATTR source)))
  ;;   ...)
  ;; for the given list of boolean attributes.
  (cons 'progn
        (cl-loop for attr in attr-list
                 for attr-sym = (intern (format "htmlize-fstruct-%s" attr))
                 collect `(when (,attr-sym ,source)
                            (setf (,attr-sym ,dest) (,attr-sym ,source))))))