emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Dynamic blocks not recognized by org-element
@ 2022-04-26  6:53 Nick Dokos
  2022-04-26  7:14 ` Ihor Radchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Dokos @ 2022-04-26  6:53 UTC (permalink / raw)
  To: emacs-orgmode

Starting with `emacs -Q', I create a simple file with the following 
contents:

--8<---------------cut here---------------start------------->8---
* Clocktable

#+BEGIN: clocktable :maxlevel 3 :emphasize nil :scope file
#+END: clocktable
--8<---------------cut here---------------end--------------->8---

I position the cursor on the #+BEGIN line and evaluate
`(org-element-at-point)'. I expected to get a dynamic-block, but I get a
paragraph:

(paragraph
  (:begin 15 :end 74 :contents-begin 15 :contents-end 74 :post-blank 0 
:post-affiliated 15 :mode planning :granularity element :parent
          (section
           (:begin 15 :end 92 :contents-begin 15 :contents-end 92 
:robust-begin 15 :robust-end 90 :post-blank 0 :post-affiliated 15 :mode 
section :granularity element :parent
                   (headline
                    (:raw-value "Clocktable" :begin 1 :end 92 :pre-blank 
1 :contents-begin 15 :contents-end 92 :robust-begin 17 :robust-end 90 
:level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil 
:post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil 
:post-affiliated 1 :title "Clocktable"))))))

Looks like a bug to me.


Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.31, cairo version 1.17.4) of 2022-02-12
Package: Org mode version 9.5.3 (release_9.5.3-452-g407104 @ 
/home/nick/src/emacs/org/org-mode/lisp/)
-- 
Nick




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

* Re: [BUG] Dynamic blocks not recognized by org-element
  2022-04-26  6:53 [BUG] Dynamic blocks not recognized by org-element Nick Dokos
@ 2022-04-26  7:14 ` Ihor Radchenko
  2022-04-26  7:38   ` Nick Dokos
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2022-04-26  7:14 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Nick Dokos <ndokos@gmail.com> writes:

> --8<---------------cut here---------------start------------->8---
> * Clocktable
>
> #+BEGIN: clocktable :maxlevel 3 :emphasize nil :scope file
> #+END: clocktable
> --8<---------------cut here---------------end--------------->8---
>
> I position the cursor on the #+BEGIN line and evaluate
> `(org-element-at-point)'. I expected to get a dynamic-block, but I get a
> paragraph:

It is to be expected.
Dynamic block syntax is the following (see manual):

#+BEGIN: dynamic_block_name [args]
...
#+END:

You should not put dynamic block name after #+END:

Best,
Ihor


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

* Re: [BUG] Dynamic blocks not recognized by org-element
  2022-04-26  7:14 ` Ihor Radchenko
@ 2022-04-26  7:38   ` Nick Dokos
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Dokos @ 2022-04-26  7:38 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

On 4/26/22 03:14, Ihor Radchenko wrote:

> It is to be expected.
> Dynamic block syntax is the following (see manual):
> 
> #+BEGIN: dynamic_block_name [args]
> ...
> #+END:
>
> You should not put dynamic block name after #+END:

Thanks! I cut-and-pasted out of the documentation, so it is a doc bug instead:

    (info "(org)The clock table")

I'll send in a patch if nobody beats me to it.

-- 
Nick



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

end of thread, other threads:[~2022-04-26  7:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-26  6:53 [BUG] Dynamic blocks not recognized by org-element Nick Dokos
2022-04-26  7:14 ` Ihor Radchenko
2022-04-26  7:38   ` Nick Dokos

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