Documentation (https://orgmode.org/manual/Dynamic-Blocks.html) suggests
a name "block-update-time" for one of the blocks. This works fine with
`org-dblock-update', but fails with `org-element-dynamic-block-parser',
which will read the name of dynamic block as "block", and fail to parse
the parameters.

See the output of `org-element-parse-buffer' on the
example from the documentation:

#+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
  ...
#+END:

for me, it gets parsed as:

(dynamic-block
 (:begin 745 :end 820 :block-name "block" :arguments nil
             :contents-begin 806 :contents-end 812 :post-blank 1
             :post-affiliated 745 :mode nil :granularity nil :parent #2)
 (paragraph
  (:begin 806 :end 812 :contents-begin 806 :contents-end 812
              :post-blank 0 :post-affiliated 806 :mode nil :granularity
              nil :parent #3)
 #("  ...\n" 0 6 (:parent #4))))

It works fine when the name is a single word, like the built-in dynamic
blocks (columnview and clocktable.) I suspect that the difference comes
from the regexp used. `org-dblock-start-re' used by `org-dblock-update'
parses the name as "\S-+", i.e. everything but whitespace, while
`org-element-dynamic-block-open-re' uses "[[:word:]]+".

When you evaluate (char-syntax ?-) in an Org buffer, you get "_", which
is the symbol class, not the word class. This would explain why the
regexp fails to match correctly.

I think the best way to resolve this would be to update the regexp
org-element uses; simply replacing [[:word:]] with \S- should probably
work? At least if that's the only part that's out-of-date


-- Chris Roberts

Emacs  : GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.33, cairo version 1.16.0) of 2024-01-09
Package: Org mode version 9.6.15 (release_9.6.15 @
/usr/local/share/emacs/30.0.50/lisp/org/)

Reply via email to