emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* missing element in org-element.el
@ 2013-04-19 14:30 Thorsten Jolitz
  2013-04-19 14:37 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Jolitz @ 2013-04-19 14:30 UTC (permalink / raw)
  To: emacs-orgmode


Hi List, 

comparing this

,----------------------------------------------------------------------------
| (defconst org-element-all-elements
|   '(babel-call center-block clock comment comment-block diary-sexp drawer
|                dynamic-block example-block export-block fixed-width
|                footnote-definition headline horizontal-rule inlinetask item
|                keyword latex-environment node-property paragraph plain-list
|                planning property-drawer quote-block quote-section section
|                special-block src-block table table-row verse-block)
|   "Complete list of element types.")
`----------------------------------------------------------------------------


to this

,------------------------------------------------------------------
| (defconst org-element-secondary-value-alist
|   '((headline . :title)
|     (inlinetask . :title)
|     (item . :tag)
|     (footnote-reference . :inline-definition))
|   "Alist between element types and location of secondary value.")
`------------------------------------------------------------------

reveals that 'footnote-reference' is missing in the first list.

-- 
cheers,
Thorsten

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

* Re: missing element in org-element.el
  2013-04-19 14:30 missing element in org-element.el Thorsten Jolitz
@ 2013-04-19 14:37 ` Nicolas Goaziou
  2013-04-19 15:35   ` Thorsten Jolitz
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2013-04-19 14:37 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Hello,

Thorsten Jolitz <tjolitz@gmail.com> writes:

> comparing this
>
> ,----------------------------------------------------------------------------
> | (defconst org-element-all-elements
> |   '(babel-call center-block clock comment comment-block diary-sexp drawer
> |                dynamic-block example-block export-block fixed-width
> |                footnote-definition headline horizontal-rule inlinetask item
> |                keyword latex-environment node-property paragraph plain-list
> |                planning property-drawer quote-block quote-section section
> |                special-block src-block table table-row verse-block)
> |   "Complete list of element types.")
> `----------------------------------------------------------------------------
>
>
> to this
>
> ,------------------------------------------------------------------
> | (defconst org-element-secondary-value-alist
> |   '((headline . :title)
> |     (inlinetask . :title)
> |     (item . :tag)
> |     (footnote-reference . :inline-definition))
> |   "Alist between element types and location of secondary value.")
> `------------------------------------------------------------------
>
> reveals that 'footnote-reference' is missing in the first list.

A `footnote-reference' is an object type (see
`org-element-all-objects'), not an element: as such it doesn't belong to
`org-element-all-elements'.

`org-element-secondary-value-alist' is a list of elements and objects
containing a secondary string.


Regards,

-- 
Nicolas Goaziou

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

* Re: missing element in org-element.el
  2013-04-19 14:37 ` Nicolas Goaziou
@ 2013-04-19 15:35   ` Thorsten Jolitz
  2013-04-19 16:31     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Thorsten Jolitz @ 2013-04-19 15:35 UTC (permalink / raw)
  To: emacs-orgmode

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

> Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> comparing this
>>
>> ,----------------------------------------------------------------------------
>> | (defconst org-element-all-elements
>> |   '(babel-call center-block clock comment comment-block diary-sexp drawer
>> |                dynamic-block example-block export-block fixed-width
>> |                footnote-definition headline horizontal-rule inlinetask item
>> |                keyword latex-environment node-property paragraph plain-list
>> |                planning property-drawer quote-block quote-section section
>> |                special-block src-block table table-row verse-block)
>> |   "Complete list of element types.")
>> `----------------------------------------------------------------------------
>>
>>
>> to this
>>
>> ,------------------------------------------------------------------
>> | (defconst org-element-secondary-value-alist
>> |   '((headline . :title)
>> |     (inlinetask . :title)
>> |     (item . :tag)
>> |     (footnote-reference . :inline-definition))
>> |   "Alist between element types and location of secondary value.")
>> `------------------------------------------------------------------
>>
>> reveals that 'footnote-reference' is missing in the first list.
>
> A `footnote-reference' is an object type (see
> `org-element-all-objects'), not an element: as such it doesn't belong to
> `org-element-all-elements'.
>
> `org-element-secondary-value-alist' is a list of elements and objects
> containing a secondary string.

Ok, I see, thanks. 

What about 

,----------------
| latex-or-entity
| plain-link
| text-markup
`----------------

in 

,---------------------------------------------------------------------------------
| (defconst org-element-all-successors
|   '(export-snippet footnote-reference inline-babel-call inline-src-block
|                    latex-or-entity line-break link macro plain-link radio-target
|                    statistics-cookie sub/superscript table-cell target
|                    text-markup timestamp)
|   "Complete list of successors.")
`---------------------------------------------------------------------------------

? 

They seem to be neither elements nor objects - are they a kind of
'abstract categories' for some object types?

And I must admit that I'm not sure about the exact meaning of
'successors'. You describe elements and objects in detail in the
comment-section of org-element.el, but don't mention 'successors'. 

,---------------------------------------------------------------------
| (defconst org-element-object-successor-alist
|   '((subscript . sub/superscript) (superscript . sub/superscript)
|     (bold . text-markup) (code . text-markup) (italic . text-markup)
|     (strike-through . text-markup) (underline . text-markup)
|     (verbatim . text-markup) (entity . latex-or-entity)
|     (latex-fragment . latex-or-entity))
|   "Alist of translations between object type and successor name.
| Sharing the same successor comes handy when, for example, the
| regexp matching one object can also match the other object.")
`---------------------------------------------------------------------
 
The relation between object/successor is like concrete
subclass(es)/abstract superclass?

PS
I hope I don't go on your nerves with my questions, but I'm trying to
understand how you modeled an Org-file and its not all clear to me. 

-- 
cheers,
Thorsten

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

* Re: missing element in org-element.el
  2013-04-19 15:35   ` Thorsten Jolitz
@ 2013-04-19 16:31     ` Nicolas Goaziou
  2013-04-19 16:41       ` Thorsten Jolitz
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2013-04-19 16:31 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

Thorsten Jolitz <tjolitz@gmail.com> writes:

> What about 
>
> ,----------------
> | latex-or-entity
> | plain-link
> | text-markup
> `----------------
>
> in 
>
> ,---------------------------------------------------------------------------------
> | (defconst org-element-all-successors
> |   '(export-snippet footnote-reference inline-babel-call inline-src-block
> |                    latex-or-entity line-break link macro plain-link radio-target
> |                    statistics-cookie sub/superscript table-cell target
> |                    text-markup timestamp)
> |   "Complete list of successors.")
> `---------------------------------------------------------------------------------
>
> ? 
>
> They seem to be neither elements nor objects - are they a kind of
> 'abstract categories' for some object types?
>
> And I must admit that I'm not sure about the exact meaning of
> 'successors'. You describe elements and objects in detail in the
> comment-section of org-element.el, but don't mention 'successors'.

I do, in the "Objects" section. Successors are functions used to find
the next object of a given type. Some objects are so close that they can
share the same successor. Hence `text-markup' is a successor shared by
underline, code, verbatim, bold, italic and strike-through objects. See
`org-element-object-successor-alist' for more information.

Also, see comments above `org-element--parse-elements' to get
information about the algorithm used for object research.

> I hope I don't go on your nerves with my questions, but I'm trying to
> understand how you modeled an Org-file and its not all clear to me.

There are comments at the beginning of each section in the file: these
should give you some answers. Don't hesitate to ask if they don't
fulfill your needs.


Regards,

-- 
Nicolas Goaziou

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

* Re: missing element in org-element.el
  2013-04-19 16:31     ` Nicolas Goaziou
@ 2013-04-19 16:41       ` Thorsten Jolitz
  0 siblings, 0 replies; 5+ messages in thread
From: Thorsten Jolitz @ 2013-04-19 16:41 UTC (permalink / raw)
  To: emacs-orgmode

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

> There are comments at the beginning of each section in the file: these
> should give you some answers. Don't hesitate to ask if they don't
> fulfill your needs.

Thanks, I have to study these section comments too.  

-- 
cheers,
Thorsten

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

end of thread, other threads:[~2013-04-19 16:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-19 14:30 missing element in org-element.el Thorsten Jolitz
2013-04-19 14:37 ` Nicolas Goaziou
2013-04-19 15:35   ` Thorsten Jolitz
2013-04-19 16:31     ` Nicolas Goaziou
2013-04-19 16:41       ` Thorsten Jolitz

Code repositories for project(s) associated with this 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).