Function: combobulate--mark-extent

combobulate--mark-extent is a natively compiled function defined in combobulate-manipulation.el.

Signature

(combobulate--mark-extent START END &optional SWAP BEGINNING-OF-LINE)

Documentation

Set mark to START and point to END and activates the mark.

If SWAP is non-nil, the point and mark is exchanged after, thus reversing the order of point and mark.

If BEGINNING-OF-LINE is non-nil, then the mark is set to the beginning of line instead of START, but only if the text is considered whitespace by the mode's syntax table.

Source Code

;; Defined in /nix/store/b5fvrwzi3zvkabyzx0in6gw1cj963z46-emacs-packages-deps/share/emacs/site-lisp/combobulate-manipulation.el
(defun combobulate--mark-extent (start end &optional swap beginning-of-line)
  "Set mark to START and point to END and activates the mark.

If SWAP is non-nil, the point and mark is exchanged after, thus
reversing the order of point and mark.

If BEGINNING-OF-LINE is non-nil, then the mark is set to the
beginning of line instead of START, but only if the text is
considered whitespace by the mode's syntax table."
  (cl-macrolet
      ((change-position (f)
         `(save-excursion
            (goto-char ,f)
            (skip-chars-backward combobulate-skip-prefix-regexp
                                 (line-beginning-position))
            (when (bolp)
              (setf ,f (point))))))
    (when beginning-of-line
      (change-position start)
      (change-position end))
    (push-mark start t)
    (goto-char end)
    (activate-mark)
    (when swap
      (exchange-point-and-mark))
    (cons start end)))