Re: [O] org-element discovered inconsistensies

2019-06-10 Thread Nicolas Goaziou
Hello,

ihor  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



Re: [O] org-element discovered inconsistensies

2019-06-08 Thread ihor

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 
, items 
, 
planning 
, 
clocks 
, 
node properties 
 and 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  writes:


So these are things that I have discovered so far:

[...]

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

Regards,



Re: [O] org-element discovered inconsistensies

2019-06-08 Thread Nicolas Goaziou
Hello,

ihor  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



[O] org-element discovered inconsistensies

2019-06-03 Thread ihor

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  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!