Function: python-nav--forward-defun

python-nav--forward-defun is a byte-compiled function defined in python.el.gz.

Signature

(python-nav--forward-defun ARG)

Documentation

Internal implementation of python-nav-{backward,forward}-defun.

Uses ARG to define which function to call, and how many times repeat it.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-nav--forward-defun (arg)
  "Internal implementation of python-nav-{backward,forward}-defun.
Uses ARG to define which function to call, and how many times
repeat it."
  (let ((found))
    (while (and (> arg 0)
                (setq found
                      (python-nav--syntactically
                       (lambda ()
                         (re-search-forward
                          python-nav-beginning-of-defun-regexp nil t))
                       '>)))
      (setq arg (1- arg)))
    (while (and (< arg 0)
                (setq found
                      (python-nav--syntactically
                       (lambda ()
                         (re-search-backward
                          python-nav-beginning-of-defun-regexp nil t))
                       '<)))
      (setq arg (1+ arg)))
    found))