From mboxrd@z Thu Jan 1 00:00:00 1970 From: ihor Subject: org-element discovered inconsistensies Date: Mon, 3 Jun 2019 23:12:44 -0400 Message-ID: References: <87ef4l599r.fsf@nicolasgoaziou.fr> <87y32oip3s.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------37A8A0049F0DC3B7D5825BB9" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:48103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXzsa-0002pt-N6 for emacs-orgmode@gnu.org; Mon, 03 Jun 2019 23:12:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXzsT-0002UB-CO for emacs-orgmode@gnu.org; Mon, 03 Jun 2019 23:12:48 -0400 Received: from mail.antonovs.family ([100.25.240.195]:53622) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hXzsO-0002CS-Gv for emacs-orgmode@gnu.org; Mon, 03 Jun 2019 23:12:40 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.antonovs.family (Postfix) with ESMTP id 42ECD138BEF for ; Tue, 4 Jun 2019 03:12:31 +0000 (UTC) Received: from mail.antonovs.family ([127.0.0.1]) by localhost (mail.antonovs.family [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nCJ4ZB92S8I4 for ; Tue, 4 Jun 2019 03:12:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.antonovs.family (Postfix) with ESMTP id B6387138C47 for ; Tue, 4 Jun 2019 03:12:30 +0000 (UTC) Received: from mail.antonovs.family ([127.0.0.1]) by localhost (mail.antonovs.family [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id l-UqQgNgNZas for ; Tue, 4 Jun 2019 03:12:30 +0000 (UTC) Received: from [192.168.88.27] (ool-44c123d3.dyn.optonline.net [68.193.35.211]) by mail.antonovs.family (Postfix) with ESMTPSA id 8E621138BEF for ; Tue, 4 Jun 2019 03:12:30 +0000 (UTC) In-Reply-To: <87y32oip3s.fsf@alphaville.usersys.redhat.com> Content-Language: en-US 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" To: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------37A8A0049F0DC3B7D5825BB9 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable So these are things that I have discovered so far: =C2=A0=C2=A0=C2=A0 Property Drawer: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Element in=20 https://orgmode.org/worg/dev/org-element-api.html#orgf47acc7 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 It also states that it = has :properties field which is simply=20 not there in the code https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L151= 4 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 My assumption in is tha= t Property Drawer contains Node=20 Properties directly, as children, instead of :properties filed =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Greater Element in=20 https://orgmode.org/worg/dev/org-syntax.html#Property_Drawers =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Greater Element in source code=20 https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L233 =C2=A0=C2=A0=C2=A0=C2=A0 Node Property: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Element in=20 https://orgmode.org/worg/dev/org-syntax.html#Node_Properties =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Missing from https://orgmode.org/= worg/dev/org-element-api.htm =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Greater Element in source code=20 https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L226 =C2=A0=C2=A0=C2=A0=C2=A0 Line Break: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Object in https://orgmode.org/wor= g/dev/org-syntax.html#Line_Breaks =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Element in https://orgmode.org/wo= rg/dev/org-element-api.htm =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Object in source code=20 https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L239 Secondly, function that collects affiliated keywords=20 (|org-element--collect-affiliated-keywords) | https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L398= 8 does not take=C2=A0 granularity=20 (https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L40= 76)=20 as argument and parse objects any way: https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L402= 9 https://code.orgmode.org/bzg/org-mode/src/master/lisp/org-element.el#L403= 6 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 ba= sically 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.o= rg/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 af= filiated 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 a= bout 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/tra= ditions 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! > --------------37A8A0049F0DC3B7D5825BB9 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

So these are things that I have discovered so far:

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

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

=C2=A0=C2=A0=C2=A0=C2=A0 Line Break:
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Object in https://orgmode.org/worg/dev/org-synt= ax.html#Line_Breaks
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - Element in https://orgmode.org/worg/dev/org-element-api.= htm
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - 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--c= ollect-affiliated-keywords)

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

does not take=C2=A0 granularity=C2=A0 (https://code.orgmode.org/b= zg/org-mode/src/master/lisp/org-element.el#L4076)=C2=A0 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 basic=
ally 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 affil=
iated keywords does not take granularity into accound and seems to be alw=
ays parsing objects in Caption
keyword)

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

I can elaborate on each point but I don't want to overwhelm everybody wit=
h details right from the start. I guess the meta-question is where and ho=
w
should I discuss these points? - I never used mailing lists before (If I =
did something incorrectly or do not follow the established rituals/tradit=
ions 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!

--------------37A8A0049F0DC3B7D5825BB9--