emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Suggestion/bug: Parse inlinetask "END" with level sensitivity
@ 2014-02-17 17:44 Anders Johansson
  2014-02-17 22:05 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Anders Johansson @ 2014-02-17 17:44 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-17 23:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-17 17:44 Suggestion/bug: Parse inlinetask "END" with level sensitivity Anders Johansson
2014-02-17 22:05 ` Nicolas Goaziou
2014-02-17 23:22   ` Anders Johansson

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).