From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [BUG] Convert heading with no content to item fails Date: Sat, 17 Mar 2018 14:57:59 +0100 Message-ID: <874lleerdk.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44916) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exCLW-0004i7-7W for emacs-orgmode@gnu.org; Sat, 17 Mar 2018 09:58:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exCLT-0006YB-5v for emacs-orgmode@gnu.org; Sat, 17 Mar 2018 09:58:06 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:36011) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1exCLS-0006XA-W4 for emacs-orgmode@gnu.org; Sat, 17 Mar 2018 09:58:03 -0400 In-Reply-To: (Adrian Bradd's message of "Sat, 10 Mar 2018 22:04:04 -0500") 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" To: Adrian Bradd Cc: emacs-orgmode list Hello, Adrian Bradd writes: > On master (commit: 51b339105), attempting to convert a blank headline to an item with `org-ctrl-c-minus' removes the space after the * and org no longer recognizes it as a heading. > > I believe this issue originated in commit 69c5b6c99. Some code was added to strip metadata during the conversion in `org-toggle-item' with `org-heading-delete-metadata'. '(org-set-tags-to nil)' is used to strip tags which in the case of > the blank heading results in `(delete-region (match-beginning 1) (match-end 1))' being called. > > `delete-region' in this case removes the space immediately after the star/s in the blank headline which puts the line in a state that org doesn't consider a headline. > > Replacing the removed space following the * or preventing its removal > would remedy the issue, but I wasn't sure where to implement this. > Didn't want to make the change in `org-set-tags-to' for fear of > downstream effects. Fixed. Thank you. Regards, -- Nicolas Goaziou