emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* problem with org-element-parse-buffer
@ 2012-11-12  9:42 Peter Münster
  2012-11-12 10:55 ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Münster @ 2012-11-12  9:42 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

When using

     (print (org-element-parse-buffer 'headline))

on this test file:

* TODO test
  bla bla bla
  DEADLINE: <2012-11-08 Thu 12:17>

the output has no information about the deadline with latest
git-version.

How could I solve this problem please?

TIA for any hints,
-- 
           Peter

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

* Re: problem with org-element-parse-buffer
  2012-11-12  9:42 problem with org-element-parse-buffer Peter Münster
@ 2012-11-12 10:55 ` Nicolas Goaziou
  2012-11-24 12:00   ` Peter Münster
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2012-11-12 10:55 UTC (permalink / raw)
  To: Peter Münster; +Cc: emacs-orgmode

Hello,

Peter Münster <pmlists@free.fr> writes:

> * TODO test
>   bla bla bla
>   DEADLINE: <2012-11-08 Thu 12:17>

In Org, planning info (scheduled, deadline, and closed) must be put just
after the headline. Your example isn't valid.


Regards,

-- 
Nicolas Goaziou

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

* Re: problem with org-element-parse-buffer
  2012-11-12 10:55 ` Nicolas Goaziou
@ 2012-11-24 12:00   ` Peter Münster
  2012-11-24 12:21     ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Münster @ 2012-11-24 12:00 UTC (permalink / raw)
  To: emacs-orgmode

On Mon, Nov 12 2012, Nicolas Goaziou wrote:

>> * TODO test
>>   bla bla bla
>>   DEADLINE: <2012-11-08 Thu 12:17>
>
> In Org, planning info (scheduled, deadline, and closed) must be put just
> after the headline. Your example isn't valid.

Then, org-agenda should ignore that too, shouldn't it?

-- 
           Peter

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

* Re: problem with org-element-parse-buffer
  2012-11-24 12:00   ` Peter Münster
@ 2012-11-24 12:21     ` Nicolas Goaziou
  2012-11-24 22:03       ` Peter Münster
  2012-11-25  4:29       ` Eric Abrahamsen
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2012-11-24 12:21 UTC (permalink / raw)
  To: Peter Münster; +Cc: emacs-orgmode

Peter Münster <pmlists@free.fr> writes:

> On Mon, Nov 12 2012, Nicolas Goaziou wrote:

>> In Org, planning info (scheduled, deadline, and closed) must be put just
>> after the headline. Your example isn't valid.
>
> Then, org-agenda should ignore that too, shouldn't it?

Strictly speaking, yes. But Org Agenda is a bit permissive (and not only
for that thing). Do you want to help basing Agenda on Elements?


Regards,

-- 
Nicolas Goaziou

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

* Re: problem with org-element-parse-buffer
  2012-11-24 12:21     ` Nicolas Goaziou
@ 2012-11-24 22:03       ` Peter Münster
  2012-11-25  4:29       ` Eric Abrahamsen
  1 sibling, 0 replies; 8+ messages in thread
From: Peter Münster @ 2012-11-24 22:03 UTC (permalink / raw)
  To: emacs-orgmode

On Sat, Nov 24 2012, Nicolas Goaziou wrote:

> Do you want to help basing Agenda on Elements?

No, sorry. I don't use the agenda, I prefer push to poll. That's why I
wrote org-notify.el.

Anyway, the syntax highlighting is a bit permissive too...

-- 
           Peter

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

* Re: problem with org-element-parse-buffer
  2012-11-24 12:21     ` Nicolas Goaziou
  2012-11-24 22:03       ` Peter Münster
@ 2012-11-25  4:29       ` Eric Abrahamsen
  2012-11-25  9:11         ` Nicolas Goaziou
  1 sibling, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2012-11-25  4:29 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Peter Münster <pmlists@free.fr> writes:
>
>> On Mon, Nov 12 2012, Nicolas Goaziou wrote:
>
>>> In Org, planning info (scheduled, deadline, and closed) must be put just
>>> after the headline. Your example isn't valid.
>>
>> Then, org-agenda should ignore that too, shouldn't it?
>
> Strictly speaking, yes. But Org Agenda is a bit permissive (and not only
> for that thing). Do you want to help basing Agenda on Elements?

This is something I was wondering about -- so that is the plan
eventually? This is something I've wanted for a while, as it would make
some of my little personal projects a lot easier. I'd be happy to help
if there's a roadmap, and if I can be fed bite-sized problems to deal
with.

E

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

* Re: problem with org-element-parse-buffer
  2012-11-25  4:29       ` Eric Abrahamsen
@ 2012-11-25  9:11         ` Nicolas Goaziou
  2012-11-26  1:04           ` Eric Abrahamsen
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2012-11-25  9:11 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-orgmode

Hello,

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

>> Strictly speaking, yes. But Org Agenda is a bit permissive (and not only
>> for that thing). Do you want to help basing Agenda on Elements?
>
> This is something I was wondering about -- so that is the plan
> eventually? 

Since we have a complete parser, it would be good to use it as much as
possible. It will alleviate the need to use regexps and normalize Org
syntax.

One downside, though, is that it isn't fast enough yet for speed
critical operations (i.e. fontification). A caching mechanism would be
required to go further (any taker?).

Org Elements is quite simple to use: API basically boils down to five
functions. For a global action, the main function to use is
`org-element-parse-buffer'. At the element level (paragraphs,
tables...), it is `org-element-at-point'. At the object level (links,
emphasis...), it is `org-element-context'. Then you extract properties
(resp. type) with `org-element-property' (resp. `org-element-type').

You can get a list of all properties available for each element/object
by looking at:

  http://orgmode.org/worg/dev/org-export-reference.html#attributes

or by looking at org-element.el source code, obviously.

In order to get started, you can study navigation/manipulation functions
in org.el (from `org-forward-element' to `org-unindent-buffer').

> This is something I've wanted for a while, as it would make
> some of my little personal projects a lot easier. I'd be happy to help
> if there's a roadmap, and if I can be fed bite-sized problems to deal
> with.

There's no roadmap for now. If you're looking for small tasks to handle,
I think interactive functions are a good start (although some can be
a bit challenging, i.e. `org-open-link'). Particularly good candidates
are those calling either `org-at-regexp-p', `org-in-regexp' or
`org-between-regexps-p': using those is almost always wrong (or at least
fragile).

If you give a shot at some of them, please include ert tests: writings
tests for Org is really a must from now on. There are now plenty of
examples in testing directory.

Thank you for your interest in this.


Regards,

-- 
Nicolas Goaziou

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

* Re: problem with org-element-parse-buffer
  2012-11-25  9:11         ` Nicolas Goaziou
@ 2012-11-26  1:04           ` Eric Abrahamsen
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2012-11-26  1:04 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>>> Strictly speaking, yes. But Org Agenda is a bit permissive (and not only
>>> for that thing). Do you want to help basing Agenda on Elements?

[...]

>> This is something I've wanted for a while, as it would make
>> some of my little personal projects a lot easier. I'd be happy to help
>> if there's a roadmap, and if I can be fed bite-sized problems to deal
>> with.
>
> There's no roadmap for now. If you're looking for small tasks to handle,
> I think interactive functions are a good start (although some can be
> a bit challenging, i.e. `org-open-link'). Particularly good candidates
> are those calling either `org-at-regexp-p', `org-in-regexp' or
> `org-between-regexps-p': using those is almost always wrong (or at least
> fragile).
>
> If you give a shot at some of them, please include ert tests: writings
> tests for Org is really a must from now on. There are now plenty of
> examples in testing directory.

Great, thanks for the pointers. I'll see if I can't provide a few
patches in the next couple of weeks.

E

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

end of thread, other threads:[~2012-11-26  1:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-12  9:42 problem with org-element-parse-buffer Peter Münster
2012-11-12 10:55 ` Nicolas Goaziou
2012-11-24 12:00   ` Peter Münster
2012-11-24 12:21     ` Nicolas Goaziou
2012-11-24 22:03       ` Peter Münster
2012-11-25  4:29       ` Eric Abrahamsen
2012-11-25  9:11         ` Nicolas Goaziou
2012-11-26  1:04           ` Eric Abrahamsen

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).