Function: expreg--paragraph-defun

expreg--paragraph-defun is a natively compiled function defined in expreg.el.

Signature

(expreg--paragraph-defun)

Documentation

Return a list of regions containing paragraphs or defuns.

Source Code

;; Defined in /nix/store/29cdhkmkqv2bgp3p30khhf35kkbgx1ya-emacs-packages-deps/share/emacs/site-lisp/elpa/expreg-1.4.1/expreg.el
(defun expreg--paragraph-defun ()
  "Return a list of regions containing paragraphs or defuns."
  (condition-case nil
      (let ((orig (point))
            beg end result)

        (when beginning-of-defun-function
          (save-excursion
            (when (beginning-of-defun)
              (setq beg (point))
              (end-of-defun)
              (setq end (point))
              ;; If we are at the BOL right below a defun, don’t mark
              ;; that defun.
              (unless (eq orig end)
                (push `(paragraph-defun . ,(cons beg end)) result)))))

        (when (or (derived-mode-p 'text-mode)
                  (eq major-mode 'fundamental-mode))
          (save-excursion
            (backward-paragraph)
            (skip-syntax-forward "-")
            (setq beg (point))
            (forward-paragraph)
            (setq end (point))
            (push `(paragraph . ,(cons beg end)) result)))

        result)
    (scan-error nil)))