emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-elements: list in drawer
@ 2012-08-06 13:36 Michael Brand
  2012-08-07  7:40 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Brand @ 2012-08-06 13:36 UTC (permalink / raw)
  To: Org Mode

Hi all

M-q on the list item in this example does not try to fill:

#+BEGIN_SRC org
  ,#+DRAWERS: MYDRAWER
  ,:MYDRAWER:
  ,- a paragraph longer than one line, a paragraph longer than one
line, a paragraph longer than one line
  ,:END:
#+END_SRC

org-fill-paragraph recognizes a plain list but I think it should be a
paragraph, like when without the drawer. org-element-parse-buffer
looks to me as I would expect, org-element-at-point on the list item
looks wrong to me.

Today's release_7.8.11-374-g7791d40 on 24.1, emacs -Q.

Michael

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

* Re: org-elements: list in drawer
  2012-08-06 13:36 org-elements: list in drawer Michael Brand
@ 2012-08-07  7:40 ` Nicolas Goaziou
  2012-08-07 19:01   ` Michael Brand
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2012-08-07  7:40 UTC (permalink / raw)
  To: Michael Brand; +Cc: Org Mode

Hello,

Michael Brand <michael.ch.brand@gmail.com> writes:

> M-q on the list item in this example does not try to fill:
>
> #+BEGIN_SRC org
>   ,#+DRAWERS: MYDRAWER
>   ,:MYDRAWER:
>   ,- a paragraph longer than one line, a paragraph longer than one
> line, a paragraph longer than one line
>   ,:END:
> #+END_SRC

What do you want to fill here?  Theres a an item on a single line, then
a paragraph outside the list below.

> org-fill-paragraph recognizes a plain list but I think it should be a
> paragraph, like when without the drawer. org-element-parse-buffer
> looks to me as I would expect, org-element-at-point on the list item
> looks wrong to me.

I don't understand.  What should be a paragraph? Why does
`org-element-at-point' look wrong?

Also, remember,

  - text text text
  text outside item

is not the same as

  - text text text
    text inside item


Regards,

-- 
Nicolas Goaziou

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

* Re: org-elements: list in drawer
  2012-08-07  7:40 ` Nicolas Goaziou
@ 2012-08-07 19:01   ` Michael Brand
  2012-08-08  8:02     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Brand @ 2012-08-07 19:01 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode

Hi Nicolas

On Tue, Aug 7, 2012 at 9:40 AM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

>>   ,:MYDRAWER:
>>   ,- a paragraph longer than one line, a paragraph longer than one
>> line, a paragraph longer than one line
>>   ,:END:
>> #+END_SRC
>
> What do you want to fill here?  Theres a an item on a single line, then
> a paragraph outside the list below.

The Org source block was chosen here to show with the comma where a
line starts really in Org and where it has been wrapped by email. The
drawer contains one list with one item, on one single long line before
filling. I want to fill it into several lines, just like it happens
when “:MYDRAWER:” and “:END:” are removed before.

>> org-fill-paragraph recognizes a plain list but I think it should be a
>> paragraph, like when without the drawer. org-element-parse-buffer
>> looks to me as I would expect, org-element-at-point on the list item
>> looks wrong to me.
>
> I don't understand.  What should be a paragraph?

The “paragraph” from `org-element-parse-buffer', here the excerpt of
the drawer content:

#+BEGIN_SRC emacs-lisp
  (plain-list
   (:type unordered :begin 32 :end 135
          :contents-begin 32 :contents-end 134 :structure
          ((32 0 "- " nil nil nil 134))
          :post-blank 1 :parent #2)
   (item
    (:bullet "- " :begin 32 :end 134 :contents-begin 34 :contents-end 135
             :checkbox nil :counter nil :hiddenp nil :structure
             ((32 0 "- " nil nil nil 134))
             :post-blank 1 :tag nil :parent #3)
    (paragraph
     (:begin 34 :end 135 :contents-begin 34 :contents-end 135
             :post-blank 0 :parent #4)
     "a paragraph longer [...] longer than one line\n")))
#+END_SRC

> Why does `org-element-at-point' look wrong?

The “drawer” is inside the list and I miss “item” and its “paragraph”:

#+BEGIN_SRC emacs-lisp
  (plain-list
   (:type unordered :begin 32 :end 135
          :contents-begin 32 :contents-end 134 :structure
          ((32 0 "- " nil nil nil 134))
          :post-blank 1 :parent
          (drawer
           (:begin 21 :end 141 :drawer-name "MYDRAWER" :hiddenp nil
                   :contents-begin 32 :contents-end 135
                   :post-blank 0 :parent nil))))
#+END_SRC

I thought that it should be exactly the same as the excerpt shown
above.

Michael

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

* Re: org-elements: list in drawer
  2012-08-07 19:01   ` Michael Brand
@ 2012-08-08  8:02     ` Nicolas Goaziou
  2012-08-08 19:45       ` Michael Brand
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2012-08-08  8:02 UTC (permalink / raw)
  To: Michael Brand; +Cc: Org Mode

Hello,

Michael Brand <michael.ch.brand@gmail.com> writes:

> The drawer contains one list with one item, on one single long line
> before filling. I want to fill it into several lines, just like it
> happens when “:MYDRAWER:” and “:END:” are removed before.

I get it now.  It should be fixed.  Thanks you for the detailed report.

>> Why does `org-element-at-point' look wrong?
>
> The “drawer” is inside the list and I miss “item” and its “paragraph”:
>
> #+BEGIN_SRC emacs-lisp
>   (plain-list
>    (:type unordered :begin 32 :end 135
>           :contents-begin 32 :contents-end 134 :structure
>           ((32 0 "- " nil nil nil 134))
>           :post-blank 1 :parent
>           (drawer
>            (:begin 21 :end 141 :drawer-name "MYDRAWER" :hiddenp nil
>                    :contents-begin 32 :contents-end 135
>                    :post-blank 0 :parent nil))))
> #+END_SRC

The drawer isn't inside the list, it is the value of its `:parent'
property.  Also, `org-element-at-point' doesn't parse contents, so
there's no reason that there would be the item and the paragraph.

Obviously, `org-element-at-point' output depends on the position of
point. Try various positions in the same line and you will get,
consistently, `plain-list', `item' and `paragraph' elements.


Regards,

-- 
Nicolas Goaziou

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

* Re: org-elements: list in drawer
  2012-08-08  8:02     ` Nicolas Goaziou
@ 2012-08-08 19:45       ` Michael Brand
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Brand @ 2012-08-08 19:45 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode

Hi Nicolas

On Wed, Aug 8, 2012 at 10:02 AM, Nicolas Goaziou <n.goaziou@gmail.com> wrote:

> I get it now.  It should be fixed.  Thanks you for the detailed report.

I can confirm, thank you.

>> #+BEGIN_SRC emacs-lisp
>>   (plain-list
>>    (:type unordered :begin 32 :end 135
>>           :contents-begin 32 :contents-end 134 :structure
>>           ((32 0 "- " nil nil nil 134))
>>           :post-blank 1 :parent
>>           (drawer
>>            (:begin 21 :end 141 :drawer-name "MYDRAWER" :hiddenp nil
>>                    :contents-begin 32 :contents-end 135
>>                    :post-blank 0 :parent nil))))
>> #+END_SRC
>
> The drawer isn't inside the list, it is the value of its `:parent'
> property.

Oh, now I see. It seems that I have to not read over too many of the
“details” of the output of `pp-to-string' (pretty print). Is there a
way to pretty print so that a property value never starts a line and
leaves its property name alone at the end of the previous line?

> Also, `org-element-at-point' doesn't parse contents, so
> there's no reason that there would be the item and the paragraph.
>
> Obviously, `org-element-at-point' output depends on the position of
> point. Try various positions in the same line and you will get,
> consistently, `plain-list', `item' and `paragraph' elements.

Ok, clear. My wrong expectation was that it would return the element
at point including the complete subtree of the structure.

Michael

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

end of thread, other threads:[~2012-08-08 19:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06 13:36 org-elements: list in drawer Michael Brand
2012-08-07  7:40 ` Nicolas Goaziou
2012-08-07 19:01   ` Michael Brand
2012-08-08  8:02     ` Nicolas Goaziou
2012-08-08 19:45       ` Michael Brand

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