Function: idlwave-block-jump-out

idlwave-block-jump-out is an interactive and byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-block-jump-out &optional DIR NOMARK)

Documentation

When optional argument DIR is non-negative, move forward to end of current block using the idlwave-begin-block-reg and idlwave-end-block-reg regular expressions. When DIR is negative, move backwards to block beginning. Recursively calls itself to skip over nested blocks. DIR defaults to forward. Calls push-mark unless the optional argument NOMARK is non-nil. Movement is limited by the start of program units because of possibility of unbalanced blocks.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/idlwave.el.gz
(defun idlwave-block-jump-out (&optional dir nomark)
  "When optional argument DIR is non-negative, move forward to end of
current block using the `idlwave-begin-block-reg' and `idlwave-end-block-reg'
regular expressions.  When DIR is negative, move backwards to block beginning.
Recursively calls itself to skip over nested blocks.  DIR defaults to
forward.  Calls `push-mark' unless the optional argument NOMARK is
non-nil.  Movement is limited by the start of program units because of
possibility of unbalanced blocks."
  (interactive "P")
  (or dir (setq dir 0))
  (let* ((here (point))
         (case-fold-search t)
         (limit (if (>= dir 0) (point-max) (point-min)))
         (block-limit (if (>= dir 0)
			  idlwave-begin-block-reg
			idlwave-end-block-reg))
         found
         (block-reg (concat idlwave-begin-block-reg "\\|"
			    idlwave-end-block-reg))
         (unit-limit (or (save-excursion
			   (if (< dir 0)
			       (idlwave-find-key
				idlwave-begin-unit-reg dir t limit)
			     (end-of-line)
			     (idlwave-find-key
			      idlwave-end-unit-reg dir t limit)))
			 limit)))
    (if (>= dir 0) (end-of-line)) ;Make sure we are in current block
    (if (setq found (idlwave-find-key  block-reg dir t unit-limit))
        (while (and found (looking-at block-limit))
          (if (>= dir 0) (forward-word-strictly 1))
          (idlwave-block-jump-out dir t)
          (setq found (idlwave-find-key block-reg dir t unit-limit))))
    (if (not nomark) (push-mark here))
    (if (not found) (goto-char unit-limit)
      (if (>= dir 0) (forward-word-strictly 1)))))