From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anders Johansson Subject: Suggestion/bug: Parse inlinetask "END" with level sensitivity Date: Mon, 17 Feb 2014 18:44:39 +0100 Message-ID: <53024A87.6030901@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFSFY-0004rh-Rq for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 12:45:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFSFQ-0004d7-FU for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 12:45:00 -0500 Received: from mail-lb0-x234.google.com ([2a00:1450:4010:c04::234]:51273) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFSFQ-0004bp-6Z for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 12:44:52 -0500 Received: by mail-lb0-f180.google.com with SMTP id n15so11619722lbi.11 for ; Mon, 17 Feb 2014 09:44:42 -0800 (PST) Received: from [130.238.195.202] (048417.physics.uu.se. [130.238.195.202]) by mx.google.com with ESMTPSA id dm8sm26881389lad.7.2014.02.17.09.44.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 09:44:40 -0800 (PST) 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: emacs-orgmode@gnu.org Hi. I recently started using inlinetasks to be able to tag and comment long texts (a kind of simple qualitative data analysis). I thought that I would be able to use both tasks with and without an "END" line interchangeably: *************** inlinetask without end some text *************** inlinetask with end text inside inlinetask *************** END The problem (not so surprising really) is that the parser finds the "END" of the second inlinetask and makes them nested in an export. I thought this could be solved with using different numbers of stars for tasks with and without END, judging from these lines in org-inlinetask.el: ;; If you need to have a time planning line (DEADLINE etc), drawers, ;; for example LOGBOOK of PROPERTIES, or even normal text as part of ;; the inline task, you must add an "END" headline with the same ;; number of stars. But the search for "END" in the parser is actually star-insensitive so this didn't solve my problem either. I suggest requiring the "END"-line to contain as many stars as it's beginning line by doing something like this (there is certainly a cleaner way doing it) to org-element-inlinetask-parser: @@ -972,7 +972,9 @@ plist)))) (task-end (save-excursion (end-of-line) - (and (re-search-forward "^\\*+ END" limit t) + (and (re-search-forward + (concat "^" (mapconcat 'identity (make-list (nth 1 components) "\\*") "") " END") + limit t) (match-beginning 0)))) (contents-begin (progn (forward-line) (and task-end (< (point) task-end) (point)))) But perhaps this is too unstable? (Although it could be expected from the comments above). Cheers, Anders Johansson