From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mats Kindahl Subject: Re: [PATCH] Resolve regexp ambiguity for item headers Date: Mon, 10 Sep 2012 21:35:52 +0200 Message-ID: <504E4118.3040700@oracle.com> References: <504DE922.1000707@oracle.com> <87ehm93fd7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------000901020308030602000505" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB9mJ-0008K5-3h for emacs-orgmode@gnu.org; Mon, 10 Sep 2012 15:36:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TB9mF-0007RS-D6 for emacs-orgmode@gnu.org; Mon, 10 Sep 2012 15:36:15 -0400 Received: from acsinet15.oracle.com ([141.146.126.227]:18952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB9mF-0007RI-6M for emacs-orgmode@gnu.org; Mon, 10 Sep 2012 15:36:11 -0400 In-Reply-To: <87ehm93fd7.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: emacs-orgmode This is a multi-part message in MIME format. --------------000901020308030602000505 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 09/10/2012 08:24 PM, Nicolas Goaziou wrote: > Hello, > > Mats Kindahl writes: > >> I solved this issue by requiring that there should always be a headline >> text (this is after all an assumption made in the code) and rewrote the >> org-complex-heading-regexp accordingly. > Actually, I have recently committed a change going exactly the opposite > way. I'm not certain which solution is better, but I tend to think empty > headlines should be valid and parts of Org choking on empty headlines > should be fixed. Hi Nicolas, Interesting. :) Well... the most important point for me is that it shouldn't choke on these lines, but otherwise I'm open to suggestions. My rationale for doing it this way was: * The code I looked at assumes that the headline text is there, so it's likely that it's the common assumption. * It is clearly the case that todo keywords are optional. * It is not so clear that the headline text is optional However: * The regular expression matches completely empty headlines, so maybe the intention is to allow matching items with just a todo keyword? I would be very interested if anybody could shed some light on this. Best wishes, Mats Kindahl -- Senior Principal Software Developer Oracle, MySQL Department --------------000901020308030602000505 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 09/10/2012 08:24 PM, Nicolas Goaziou wrote:
Hello,

Mats Kindahl <mats.kindahl@oracle.com> writes:

I solved this issue by requiring that there should always be a headline
text (this is after all an assumption made in the code) and rewrote the
org-complex-heading-regexp accordingly.
Actually, I have recently committed a change going exactly the opposite
way. I'm not certain which solution is better, but I tend to think empty
headlines should be valid and parts of Org choking on empty headlines
should be fixed.

Hi Nicolas,

Interesting. :)

Well... the most important point for me is that it shouldn't choke on these lines, but otherwise I'm open to suggestions.

My rationale for doing it this way was:
  • The code I looked at assumes that the headline text is there, so it's likely that it's the common assumption.
  • It is clearly the case that todo keywords are optional.
  • It is not so clear that the headline text is optional

However:

  • The regular expression matches completely empty headlines, so maybe the intention is to allow matching items with just a todo keyword?

I would be very interested if anybody could shed some light on this.

Best wishes,
Mats Kindahl

-- 
Senior Principal Software Developer
Oracle, MySQL Department
--------------000901020308030602000505--