Function: org-in-src-block-p
org-in-src-block-p is a byte-compiled function defined in org.el.gz.
Signature
(org-in-src-block-p &optional INSIDE ELEMENT)
Documentation
Whether point is in a code source block.
When INSIDE is non-nil, don't consider we are within a source block when point is at #+BEGIN_SRC or #+END_SRC. When ELEMENT is provided, it is considered to be element at point.
Source Code
;; Defined in /usr/src/emacs/lisp/org/org.el.gz
(defun org-in-src-block-p (&optional inside element)
"Whether point is in a code source block.
When INSIDE is non-nil, don't consider we are within a source
block when point is at #+BEGIN_SRC or #+END_SRC.
When ELEMENT is provided, it is considered to be element at point."
(save-match-data (setq element (or element (org-element-at-point))))
(when (eq 'src-block (org-element-type element))
(or (not inside)
(not (or (= (line-beginning-position)
(org-element-property :post-affiliated element))
(= (1+ (line-end-position))
(- (org-element-property :end element)
(org-element-property :post-blank element))))))))