[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] org-babel-where-is-src-block-head
From: |
Nicolas Goaziou |
Subject: |
Re: [Orgmode] org-babel-where-is-src-block-head |
Date: |
Tue, 07 Sep 2010 22:40:28 +0200 |
User-agent: |
Wanderlust/2.15.9 (Almost Unreal) Emacs/23.2 Mule/6.0 (HANACHIRUSATO) |
Hello,
>>>>> Jambunathan K writes:
>> [1] E.g. `org-babel-where-is-src-block-head' may not be the
>> "proper" way to detect if we're in a src block.
>>
> I wonder what the proper way is ...
> At different points in the past, I had looked for org-at-babel-p or
> something similar. I invariably wound up using
> org-babel-where-is-src-block-head ...
I don't know it either but there is `org-in-regexps-block-p' for
general use, and in org-list, I used something in the lines of this:
(defun in-src-block-p ()
(save-excursion
(let ((case-fold-search t))
(end-of-line)
(and (re-search-backward "^[ \t]*#\\+\\(begin\\|end\\)_src" nil t)
(= (length (match-string 1)) 5)))))
Regards,
-- Nicolas