From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: [babel] problems with org-babel-src-block-regexp (full text) Date: Mon, 22 Mar 2010 11:27:00 -0600 Message-ID: <87tys8468r.fsf@gmail.com> References: <873a06iyfu.fsf@cuma.i-did-not-set--mail-host-address--so-tickle-me> <87y6hyhj3m.fsf@cuma.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ntp5O-0004q3-Ce for emacs-orgmode@gnu.org; Mon, 22 Mar 2010 17:22:58 -0400 Received: from [140.186.70.92] (port=34253 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ntp5N-0004pV-3E for emacs-orgmode@gnu.org; Mon, 22 Mar 2010 17:22:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ntp5L-0003dq-Us for emacs-orgmode@gnu.org; Mon, 22 Mar 2010 17:22:56 -0400 Received: from fg-out-1718.google.com ([72.14.220.152]:26647) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ntp5L-0003dm-QE for emacs-orgmode@gnu.org; Mon, 22 Mar 2010 17:22:55 -0400 Received: by fg-out-1718.google.com with SMTP id d23so854895fga.12 for ; Mon, 22 Mar 2010 14:22:54 -0700 (PDT) In-Reply-To: <87y6hyhj3m.fsf@cuma.i-did-not-set--mail-host-address--so-tickle-me> (Maurizio Vitale's message of "Thu, 11 Mar 2010 12:19:09 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: maurizio.vitale@polymath-solutions.com Cc: emacs-orgmode@gnu.org Hi Maurizio, Thanks for finding and demonstrating this bug. It should now be fixed. Best -- Eric Maurizio Vitale writes: > [sorry for the double posting, but the control char in the regexp > prevented the full message from appearing. This is what I meant to send] > > There're problems with org-babel-src-block-regexp when the src block > contains the block delimiters (for instance in strings or comments). > > Granted, this is an uncommon occurrence (which I discovered by accident) > editing an org-file containing elisp code that needed to insert > #+begin_src...#+end_src pairs, but if it is not too difficult to fix it > would be nice to have a more useful behaviour. > > This is my setting (replaced 0x0 with ^@ to avoid posting problems): > org-babel-src-block-regexp is a variable defined in `org-babel.el'. > Its value is > "^[ ]*#\\+begin_src[ ]+\\(python\\|sh\\|emacs-lisp\\)[ ]*\\([^\":\n]*\"[^\"\n*]*\"[^\":\n]*\\|[^\":\n]*\\)\\([^\n]*\\)\n\\([^^@]+?\\)#\\+end_src" > > And these are two test cases. I'm particularly puzzled by the first, > because the regexp seems to be anchored to the begin of line and hence > it shouldn't match the begin_src inside the string. > For end_src, it should probably be anchored to the begin of line. > > #+begin_src emacs-lisp > ;;; evaluating the following C-x C-e with the point at the end is ok > (org-babel-where-is-src-block-head) > (defun foo () (insert "#+begin_src emacs-lisp")) > ;;; evaluating the following C-x C-e with the point at the end is not ok > (org-babel-where-is-src-block-head) > #+end_src > > #+begin_src emacs-lisp > ;;; evaluating the following C-x C-e with the point at the end is ok > (org-babel-where-is-src-block-head) > (defun foo () (insert "#+end_src emacs-lisp")) > ;;; evaluating the following C-x C-e with the point at the end is not ok > (org-babel-where-is-src-block-head) > #+end_src > > Best regards, > > Maurizio > > > > > > _______________________________________________ > 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