Function: org-in-block-p
org-in-block-p is a byte-compiled function defined in org.el.gz.
Signature
(org-in-block-p NAMES)
Documentation
Non-nil when point belongs to a block whose name belongs to NAMES.
NAMES is a list of strings containing names of blocks.
Return first block name matched, or nil. Beware that in case of nested blocks, the returned name may not belong to the closest block from point.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-in-block-p (names)
"Non-nil when point belongs to a block whose name belongs to NAMES.
NAMES is a list of strings containing names of blocks.
Return first block name matched, or nil. Beware that in case of
nested blocks, the returned name may not belong to the closest
block from point."
(save-match-data
(catch 'exit
(let ((case-fold-search t)
(lim-up (save-excursion (outline-previous-heading)))
(lim-down (save-excursion (outline-next-heading))))
(dolist (name names)
(let ((n (regexp-quote name)))
(when (org-between-regexps-p
(concat "^[ \t]*#\\+begin_" n)
(concat "^[ \t]*#\\+end_" n)
lim-up lim-down)
(throw 'exit n)))))
nil)))