Function: idlwave-do-action

idlwave-do-action is a byte-compiled function defined in idlwave.el.gz.

Signature

(idlwave-do-action ACTION)

Documentation

Perform an action repeatedly on a line.

ACTION is a list (REG . FUNC). REG is a regular expression. FUNC is either a function which will be called with one argument is-action or a list to be evaluated with eval. The action performed by FUNC should leave point after the match for REG
- otherwise an infinite loop may be entered.
FUNC is always passed a final argument of is-action, so it can discriminate between being run as an action, or a key binding.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/idlwave.el.gz
(defun idlwave-do-action (action)
  "Perform an action repeatedly on a line.
ACTION is a list (REG . FUNC).  REG is a regular expression.  FUNC is
either a function which will be called with one argument `is-action' or
a list to be evaluated with `eval'.
The action performed by FUNC should leave point after the match for REG
- otherwise an infinite loop may be entered.
FUNC is always passed a final argument of `is-action', so it
can discriminate between being run as an action, or a key binding."
  (let ((action-key (car action))
        (action-routine (cdr action)))
    (beginning-of-line)
    (while (idlwave-look-at action-key)
      (if (functionp action-routine)
          (funcall action-routine 'is-action)
        (eval (append action-routine '('is-action)) t)))))