On Wednesday, 16 April 2025 10:12:58 UTC chris wrote: > Hello, > > *Environment:* > > - *Emacs version:* 30.1 > - *Org-mode version:* commit e49e630c6d > - *Invocation:* Tested with `emacs -Q` > > *Steps to Reproduce:* > > 1. Start Emacs with a minimal configuration: > ```shell > emacs -Q > ``` > 2. Open a new buffer (for example, the `*scratch*` buffer) and have the > buffer contain the exact following content, > two empty lines at the beginning of the buffer, then `#+x:\n: y\nx` (the > last `x` is included solely for visualization purpose): > ```text > > #+x: > : y > > x > ``` > 4. Activate Org mode: > ``` > M-x org-mode > ``` > 5. Evaluate the following code > ```elisp > (insert (prog1 (org-element-interpret-data > (org-element-parse-buffer)) > (erase-buffer))) > ``` > That is, do `M-: (insert (prog1 (org-element-interpret-data (org-element- > parse-buffer)) (erase-buffer)))`. > > *Observed Behavior:* > > - *Glitch 1:* Each time the command is executed, a new empty line is > inserted immediately after the line containing `: y`. > - *Glitch 2:* If there are extra empty lines at the beginning of the buffer, > executing the command causes these lines to disappear. > > Thanks, > Chris
I forgot to say that if there are are multiple occurrences of the pattern, only the first one triggers the extra empty newlines.