Function: gnuplot--beginning-of-defun

gnuplot--beginning-of-defun is a natively compiled function defined in gnuplot.el.

Signature

(gnuplot--beginning-of-defun &optional ARG)

Documentation

We also treat a block of continuation lines as a defun.

ARG is optional arg.

Source Code

;; Defined in /nix/store/xvcy7r1jiw71avhnh6kmin403kpqrdhc-emacs-packages-deps/share/emacs/site-lisp/elpa/gnuplot-20260623.1111/gnuplot.el
(defun gnuplot--beginning-of-defun (&optional arg)
  "We also treat a block of continuation lines as a `defun'.
ARG is optional arg."
  (unless arg (setq arg 1))
  (if (> arg 0)
      (catch 'bob               ; go to beginning of ARGth prev. defun
        (dotimes (_n arg)
          (when (= (point)
                   (gnuplot--point-at-beginning-of-continuation))
            (forward-line -1)
            (if (bobp) (throw 'bob t))
            (while (looking-at "^\\s-*$")
              (forward-line -1)
              (if (bobp) (throw 'bob t))))
          (gnuplot--beginning-of-continuation))
        t)

    (catch 'eob                   ; find beginning of (-ARG)th following defun
      (dotimes (_n (- arg))
        (gnuplot--end-of-continuation)
        (forward-line)
        (if (eobp) (throw 'eob t))
        (while (looking-at "^\\s-*$")
          (forward-line)
          (if (eobp) (throw 'eob t)))))))