From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Subject: Re: [BUG] Unmatched #+end-src Date: Sat, 12 Mar 2011 21:07:31 +0100 Message-ID: <87bp1gw1a4.fsf@gmail.com> References: <87ei6cffbw.fsf@btinternet.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=41794 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PyV65-0002Nc-G1 for emacs-orgmode@gnu.org; Sat, 12 Mar 2011 15:07:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PyV63-0002n7-RX for emacs-orgmode@gnu.org; Sat, 12 Mar 2011 15:07:33 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:50099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PyV63-0002mj-Mc for emacs-orgmode@gnu.org; Sat, 12 Mar 2011 15:07:31 -0500 Received: by wyf19 with SMTP id 19so3860963wyf.0 for ; Sat, 12 Mar 2011 12:07:31 -0800 (PST) In-Reply-To: (aankhen@gmail.com's message of "Sun, 13 Mar 2011 00:59:07 +0530") 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: Aankhen Cc: Martyn Jago , Org-mode ml Hello, Aankhen writes: >> --8<---------------cut here---------------start------------->8--- >> * Unmatched #+end-src bug >> >> #+end_src >> --8<---------------cut here---------------end--------------->8--- >> >> With the above simple org file, placing the cursor at the end of >> #+end_src and hitting return causes emacs to hang. >> > The =cond= is part of a =while= loop; it just keeps looping, entering > that branch and doing nothing (rather than moving point and picking up > again from there). Going by the other branches, I think the correct > thing to do is just exit the loop: I don't think exiting the loop that way is the right thing to do, as it always return nil, even though the #+end_ might be in the list. Moreover, there are other parts of the file that should also be fixed. I think there are 3 options here: 1. Effectively stop everything, but at least throw an informative error. 2. Consider the #+end_ as normal text after all, and resume the loop. 3. Consider #+end_ as normal text and message the user about his syntax problem. I'm not sure yet what's the best way to go, but I think option 2 is sufficient. Regards, -- Nicolas