Function: embark--narrow-to-target

embark--narrow-to-target is a byte-compiled function defined in embark.el.

Signature

(embark--narrow-to-target &rest REST &key RUN BOUNDS &allow-other-keys)

Documentation

Narrow buffer to target if its BOUNDS are known.

Intended for use as an Embark around-action hook. This function runs RUN with the buffer narrowed to given BOUNDS passing along the REST of the arguments.

Source Code

;; Defined in ~/.emacs.d/elpa/embark-20260610.302/embark.el
(cl-defun embark--narrow-to-target
    (&rest rest &key run bounds &allow-other-keys)
  "Narrow buffer to target if its BOUNDS are known.
Intended for use as an Embark around-action hook.  This function
runs RUN with the buffer narrowed to given BOUNDS passing along
the REST of the arguments."
  (if bounds
    (save-excursion
      (save-restriction
        (narrow-to-region (car bounds) (cdr bounds))
        (goto-char (car bounds))
        (apply run :bounds bounds rest)))
    (apply run rest)))