Subject: Re: bug#64339: 29.0.50; incorrect org-mode dynamic blocks docs

From: Eli Zaretskii <[email-masked]>
Date: Thu, 29 Jun 2023 07:58:50 +0300

> From: [email-masked]
> Date: Thu, 29 Jun 2023 01:36:00 +0500
> 
> Please check the following documentation (or implementation) of org-mode
> dynamic blocks:
> 
> 1. It seems that dynamic blocks can't have inner headlines (the
> org-dblock-write:xxx should not produce them). Otherwise the block will
> be parsed incorrectly (not mentioned in docs for org-mode).
> 
> Example: Create the following 1.org and export it to unicode text (press
> C-c C-e t U). You will see "#+BEGIN: block2" as text.
> 
>   * Block2
>   
>   #+BEGIN: block2
>   ** Section 1
>   asdasdsad
>   #+END:
>   
> 2. Org-mode info file says:
> 
>      Dynamic blocks, like any other block, can be narrowed with
>   ‘org-narrow-to-block’.
> 
> That would not work because of implementation of org-narrow-to-block:
> 
> (defun org-narrow-to-block ()
>   "Narrow buffer to the current block."
>   (interactive)
>   (let* ((case-fold-search t)
> 	 (blockp (org-between-regexps-p "^[ \t]*#\\+begin_.*"  <----
> 					"^[ \t]*#\\+end_.*")))
>     (if blockp
> 	(narrow-to-region (car blockp) (cdr blockp))
>       (user-error "Not in a block"))))
> 
> 
> 
> There is also a minor bug in org-mode (sould I report it
> in it's own mail?):
> 
> If you press C-c C-, [RET] [RET] You'll get:
> 
> #+begin_
> #+end_nil
> 
> while one could expect either begin_nil or end_. 

Could you please report this to the Org developers first?  It sounds
like a problem in Org or its documentation.

Thanks.