[Orgmode] org-babel-where-is-src-block-head

2010-09-07 Thread Jambunathan K

 [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 ...

Jambunathan K.



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] org-babel-where-is-src-block-head

2010-09-07 Thread Nicolas Goaziou
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

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode