Function: org-block-map

org-block-map is a byte-compiled function defined in org.el.gz.

Signature

(org-block-map FUNCTION &optional START END)

Documentation

Call FUNCTION at the head of all source blocks in the current buffer.

Optional arguments START and END can be used to limit the range.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org.el.gz
;;; Blocks

(defun org-block-map (function &optional start end)
  "Call FUNCTION at the head of all source blocks in the current buffer.
Optional arguments START and END can be used to limit the range."
  (let ((start (or start (point-min)))
        (end (or end (point-max))))
    (save-excursion
      (goto-char start)
      (while (and (< (point) end) (re-search-forward "^[ \t]*#\\+begin" end t))
	(save-excursion
	  (save-match-data
            (goto-char (match-beginning 0))
            (when (org-at-block-p)
              (funcall function))))))))