~org-blank-before-new-entry~ does also not work as expected for me using ~org-capture~. However, I would like to HAVE blank lines for new entries. But this setting takes only affect within the date tree (see below):

Emacs -q with the following Customize settings:

;;; -*- lexical-binding: t -*-
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(org-blank-before-new-entry '((heading . t) (plain-list-item . auto)))
 '(org-capture-templates
   '(("n" "Note" entry (file+olp+datetree "~/tmp.org") "")
     ("t" "Task" entry (file+headline "~/tmp.org" "Tasks") ""))))

Produces the following tmp.org (a previously non-existing file):

* 2025

** 2025-05 Mai

*** 2025-05-21 Mittwoch
**** Note 1
  [[help:org-blank-before-new-entry]]
**** Note 2
  [[help:org-blank-before-new-entry]]
* Tasks
** Task 1
  [[help:org-blank-before-new-entry]]
** Task 2
  [[help:org-blank-before-new-entry]]

Setting ~org-blank-before-new-entry~ to 'never' via the Customize interface produces the following code:

;;; -*- lexical-binding: t -*-
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(org-blank-before-new-entry '((heading) (plain-list-item . auto)))
 '(org-capture-templates
   '(("n" "Note" entry (file+olp+datetree "~/tmp.org") "")
     ("t" "Task" entry (file+headline "~/tmp.org" "Tasks") ""))))

Note, the first entry is NOT ~(heading . nil)~, but only ~(heading)~! This might already fixes OPs problem.

This produces the IMO correct outline in tmp.org:

* 2025
** 2025-05 Mai
*** 2025-05-21 Mittwoch
**** Note 1
**** Note 2
* Tasks
** Task 1
** Task 2

Best

Jonas

Emacs  : GNU Emacs 30.1 (build 2, x86_64-w64-mingw32)  of 2025-02-23
Package: Org mode version 9.7.11 (release_9.7.11 @ c:/Users/XXX/bin/emacs-30.1/share/emacs/30.1/lisp/org/)

Reply via email to