emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Re: Fwd: Questions about org-element
       [not found]     ` <87ef4l599r.fsf@nicolasgoaziou.fr>
@ 2019-05-29 23:06       ` Ngor
  2019-05-30  3:43         ` Nick Dokos
  0 siblings, 1 reply; 6+ messages in thread
From: Ngor @ 2019-05-29 23:06 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2370 bytes --]

Hi Org community.

I am re-posting my questions here according to Nicolas' recommendation.

I am working on a standalone parser implementation for Org which is
basically a translation of elisp program to Rust
https://github.com/org-rs/org-rs

There are couple of things I wanted to ask about:

1) I have discovered several inconsistencies and errors in the Syntax/API
documentation
https://orgmode.org/worg/dev/org-element-api.html vs
https://orgmode.org/worg/dev/org-syntax.html vs elisp source
And I don't know the right way to report them.

2) I think I have found a bug in the algorithm (org-element-collect
affiliated keywords does not take granularity into accound and seems to be
always parsing objects in Caption keyword)

3) I have a question regarding the elisp source source (specifically about
the :parent of the parsed objects of the keyword)

I can elaborate on each point but I don't want to overwhelm everybody with
details right from the start. I guess the meta-question is where and how
should I discuss these points? - I never used mailing lists before (If I
did something incorrectly or do not follow the established
rituals/traditions please do not judge me harshly. )

Thanks
Ihor


On Sun, May 26, 2019 at 3:02 PM Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Ngor <ngortheone@gmail.com> writes:
>
> > Sorry to bother you. Just want to make sure that you've received my
> > email..
>
> I confirm I received this one. However, I suggest to communicate through
> to the Org mailing list (<mailto:emacs-orgmode@gnu.org>).
>
> >> I am working on a standalone parser for Org
> >> https://github.com/org-rs/org-rs/tree/master
> >>
> >> I closely follow the original elisp algorithm and read
> >> - https://orgmode.org/worg/dev/org-element-api.html
> >> - https://orgmode.org/worg/dev/org-syntax.html
> >>
> >> I have discovered several inconsistencies and errors in the
> >> Syntax/API documentation, as well as I think I have found a bug in
> >> the algorithm.
>
> Please report them.
>
> Note that the cache is currently known as buggy. Help is welcome to fix,
> or re-implement it.
>
> >> Also I have some questions regarding some aspects of the algorithm.
>
> Feel free to ask questions. I'll do my best to help you. However, I am
> very busy at the moment, so do not expect too much from me.
>
> Regards,
>
> --
> Nicolas Goaziou
>

[-- Attachment #2: Type: text/html, Size: 3869 bytes --]

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

* Re: Fwd: Questions about org-element
  2019-05-29 23:06       ` Fwd: Questions about org-element Ngor
@ 2019-05-30  3:43         ` Nick Dokos
  2019-06-04  3:12           ` org-element discovered inconsistensies ihor
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Dokos @ 2019-05-30  3:43 UTC (permalink / raw)
  To: emacs-orgmode

Ngor <ngortheone@gmail.com> writes:

> Hi Org community.
>
> I am re-posting my questions here according to Nicolas' recommendation.
>
> I am working on a standalone parser implementation for Org which is basically a translation of elisp program to Rust
> https://github.com/org-rs/org-rs
>
> There are couple of things I wanted to ask about:
>
> 1) I have discovered several inconsistencies and errors in the Syntax/API documentation
> https://orgmode.org/worg/dev/org-element-api.html vs https://orgmode.org/worg/dev/org-syntax.html vs elisp source
> And I don't know the right way to report them.
>
> 2) I think I have found a bug in the algorithm (org-element-collect affiliated keywords does not take granularity into accound and seems to be always parsing objects in Caption
> keyword)
>
> 3) I have a question regarding the elisp source source (specifically about the :parent of the parsed objects of the keyword)
>
> I can elaborate on each point but I don't want to overwhelm everybody with details right from the start. I guess the meta-question is where and how
> should I discuss these points? - I never used mailing lists before (If I did something incorrectly or do not follow the established rituals/traditions please do not judge me harshly.
> )
>

No need for metaquestions: ask away.

You might want to report related problems together, but if the
connection is tenuous or non-existent, then separate posts to the
mailing list will probably work better. Asking your question in a
separate post is probably best, so it doesn't get lost in the forest
of detail when reporting problems.

If you suspect a bug, then use 'M-x org-submit-bug-report`: the bug
report will end up here and will contain a lot of information about
your set-up which might be helpful.

Finally, be patient: do not expect answers (particularly when the
questions are complicated, as it seems yours will be). It takes
a while for people to get around to even reading the posts, let
alone coming up with answers (or, as is likely, more quesions for
you).

And welcome to mailing lists in general and this mailing list in
particular!

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler

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

* org-element discovered inconsistensies
  2019-05-30  3:43         ` Nick Dokos
@ 2019-06-04  3:12           ` ihor
  2019-06-08 22:56             ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: ihor @ 2019-06-04  3:12 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 4155 bytes --]

So these are things that I have discovered so far:

     Property Drawer:
        - Element in 
https://orgmode.org/worg/dev/org-element-api.html#orgf47acc7
          It also states that it has :properties field which is simply 
not there in the code
https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L1514
          My assumption in is that Property Drawer contains Node 
Properties directly, as children, instead of :properties filed

        - Greater Element in 
https://orgmode.org/worg/dev/org-syntax.html#Property_Drawers
        - Greater Element in source code 
https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L233


      Node Property:
        - Element in 
https://orgmode.org/worg/dev/org-syntax.html#Node_Properties
        - Missing from https://orgmode.org/worg/dev/org-element-api.htm
        - Greater Element in source code 
https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L226

      Line Break:
        - Object in https://orgmode.org/worg/dev/org-syntax.html#Line_Breaks
        - Element in https://orgmode.org/worg/dev/org-element-api.htm
        - Object in source code 
https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L239

Secondly, function that collects affiliated keywords 
(|org-element--collect-affiliated-keywords) |

https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L3988

does not take  granularity 
(https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L4076) 
as argument

and parse objects any way:

https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L4029

https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L4036

Is there a reason behind this or is this a bug?


On 5/29/19 11:43 PM, Nick Dokos wrote:
> Ngor <ngortheone@gmail.com> writes:
>
>> Hi Org community.
>>
>> I am re-posting my questions here according to Nicolas' recommendation.
>>
>> I am working on a standalone parser implementation for Org which is basically a translation of elisp program to Rust
>> https://github.com/org-rs/org-rs
>>
>> There are couple of things I wanted to ask about:
>>
>> 1) I have discovered several inconsistencies and errors in the Syntax/API documentation
>> https://orgmode.org/worg/dev/org-element-api.html vs https://orgmode.org/worg/dev/org-syntax.html vs elisp source
>> And I don't know the right way to report them.
>>
>> 2) I think I have found a bug in the algorithm (org-element-collect affiliated keywords does not take granularity into accound and seems to be always parsing objects in Caption
>> keyword)
>>
>> 3) I have a question regarding the elisp source source (specifically about the :parent of the parsed objects of the keyword)
>>
>> I can elaborate on each point but I don't want to overwhelm everybody with details right from the start. I guess the meta-question is where and how
>> should I discuss these points? - I never used mailing lists before (If I did something incorrectly or do not follow the established rituals/traditions please do not judge me harshly.
>> )
>>
> No need for metaquestions: ask away.
>
> You might want to report related problems together, but if the
> connection is tenuous or non-existent, then separate posts to the
> mailing list will probably work better. Asking your question in a
> separate post is probably best, so it doesn't get lost in the forest
> of detail when reporting problems.
>
> If you suspect a bug, then use 'M-x org-submit-bug-report`: the bug
> report will end up here and will contain a lot of information about
> your set-up which might be helpful.
>
> Finally, be patient: do not expect answers (particularly when the
> questions are complicated, as it seems yours will be). It takes
> a while for people to get around to even reading the posts, let
> alone coming up with answers (or, as is likely, more quesions for
> you).
>
> And welcome to mailing lists in general and this mailing list in
> particular!
>

[-- Attachment #2: Type: text/html, Size: 7854 bytes --]

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

* Re: org-element discovered inconsistensies
  2019-06-04  3:12           ` org-element discovered inconsistensies ihor
@ 2019-06-08 22:56             ` Nicolas Goaziou
  2019-06-08 23:18               ` ihor
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2019-06-08 22:56 UTC (permalink / raw)
  To: ihor; +Cc: emacs-orgmode

Hello,

ihor <ihor@antonovs.family> writes:

> So these are things that I have discovered so far:

[...]

I think I fixed the issues you pointed out. Thank you.

Regards,

-- 
Nicolas Goaziou

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

* Re: org-element discovered inconsistensies
  2019-06-08 22:56             ` Nicolas Goaziou
@ 2019-06-08 23:18               ` ihor
  2019-06-10  9:15                 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: ihor @ 2019-06-08 23:18 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]

Great! Thanks,

I think you missed Node Properties - they are still located under 
Elements on Syntax page

https://orgmode.org/worg/dev/org-syntax.html#Elements

https://orgmode.org/worg/dev/org-syntax.html#Node_Properties

I think it should be moved to Greater Elements section

And it is also listed as Element on API page

https://orgmode.org/worg/dev/org-element-api.htm


I have also discovered more:

Syntax page states:

 > With the exception of inlinetasks 
<https://orgmode.org/worg/dev/org-syntax.html#Inlinetasks>, items 
<https://orgmode.org/worg/dev/org-syntax.html#Plain_Lists_and_Items>, 
planning 
<https://orgmode.org/worg/dev/org-syntax.html#Clock,_Diary_Sexp_and_Planning>, 
clocks 
<https://orgmode.org/worg/dev/org-syntax.html#Clock,_Diary_Sexp_and_Planning>, 
node properties 
<https://orgmode.org/worg/dev/org-syntax.html#Node_Properties> and table 
rows <https://orgmode.org/worg/dev/org-syntax.html#Table_Rows>, every 
other element type can be assigned attributes.

But  this list is not full - if you check the source code 
https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L3866

        ;; Item. +
        ;; Table Row. +
        ;; Node Property. +
        ;; Headline.
        ;; Sections (must be checked after headline).
        ;; Planning.+
        ;; Property drawer.
        ;; Paragraph.
        ;; Clock. +
        ;; Inlinetask. +
;; From there, elements can have affiliated keywords.

So Pragraph, Property Drawer, Sections and Headlines are missing from 
this list



On 6/8/19 6:56 PM, Nicolas Goaziou wrote:
> Hello,
>
> ihor <ihor@antonovs.family> writes:
>
>> So these are things that I have discovered so far:
> [...]
>
> I think I fixed the issues you pointed out. Thank you.
>
> Regards,
>

[-- Attachment #2: Type: text/html, Size: 3506 bytes --]

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

* Re: org-element discovered inconsistensies
  2019-06-08 23:18               ` ihor
@ 2019-06-10  9:15                 ` Nicolas Goaziou
  0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Goaziou @ 2019-06-10  9:15 UTC (permalink / raw)
  To: ihor; +Cc: emacs-orgmode

Hello,

ihor <ihor@antonovs.family> writes:

> I think you missed Node Properties - they are still located under
> Elements on Syntax page

Node properties are elements, so there is no omission there.

> I have also discovered more:
>
> Syntax page states:
>

[...]

> So Pragraph, Property Drawer, Sections and Headlines are missing from
> this list

I added property drawers, sections and headlines. However, paragraphs
can have affiliated keywords.

Thank you.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2019-06-10  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAKJNb8-mKR9kOTVHv6vA654GaVaA6HJUksCkrT+C4-V_D=GtNQ@mail.gmail.com>
     [not found] ` <CAKJNb8-8cdcQYFBLNgcrA=USh2LfvFYrdBOnfA+Cej4DU1BCaw@mail.gmail.com>
     [not found]   ` <CAKJNb88Rfz06jbM_BwRGpcufikzEoHuuG+xanK0q2KCEsp1juw@mail.gmail.com>
     [not found]     ` <87ef4l599r.fsf@nicolasgoaziou.fr>
2019-05-29 23:06       ` Fwd: Questions about org-element Ngor
2019-05-30  3:43         ` Nick Dokos
2019-06-04  3:12           ` org-element discovered inconsistensies ihor
2019-06-08 22:56             ` Nicolas Goaziou
2019-06-08 23:18               ` ihor
2019-06-10  9:15                 ` Nicolas Goaziou

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