lisp/org.el (org-block-map): Fix mapping over nested blocks

* lisp/org.el (org-block-map): Do not bypass the whole block when
mapping.  Look inside the block body for child blocks as well.

Reported-by: mahmood sheikh <mahmod.m2015@gmail.com>
Link: https://orgmode.org/list/CAOj1L_cx9XP5fS3_=x=UJSSt3xjcfcQ68Uef6E4DTi68Kr_ABw@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2024-05-13 14:59:45 +03:00
parent fffb87174e
commit 62356cb44b
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 3 additions and 2 deletions

View File

@ -20346,11 +20346,12 @@ Optional arguments START and END can be used to limit the range."
(end (or end (point-max))))
(save-excursion
(goto-char start)
(while (and (< (point) end) (re-search-forward org-block-regexp end t))
(while (and (< (point) end) (re-search-forward "^[ \t]*#\\+begin" end t))
(save-excursion
(save-match-data
(goto-char (match-beginning 0))
(funcall function)))))))
(when (org-at-block-p)
(funcall function))))))))
(defun org-next-block (arg &optional backward block-regexp)
"Jump to the next block.