0

I have an issue with unwanted spacing when I'm adding entries to datetree. This is the template I'm using, stripped to simplest for the purpose of testing:

("p" "Progress" entry (file+olp+datetree "~/org/progress.org") "* %?" :tree-type week))

What I'm getting as a result is this:

* 2022

** 2022-W52

*** 2022-12-28 Wednesday
**** something

and what I would like to get is this:

* 2022
** 2022-W52
*** 2022-12-28 Wednesday
**** something

I have to stress that this spacing or empty lines are still there even if I replace entry for plain or tree-type for any other option. Also, :empty-lines, empty-lines-before or empty-lines-after are not making any change as far as I can tell along with few other variables I tried setting following some advice I gathered reading similar questions.

I'm not sure why this is happening to begin with, why would anyone want so much spacing and wasted lines in org file and I would bet that I had datetrees without it earlier but I have no idea what changed. Any help much appreciated, I tried every idea that came to my mind.

4
  • What is the value of the variable org-blank-before-new-entry? You can check with C-h v org-blank-before-new-entry. Please update your question with that value.
    – NickD
    Dec 29, 2022 at 1:17
  • Both heading and plain-list-item are auto, but I did change them to nil and nothing was different.
    – Djole
    Dec 29, 2022 at 3:51
  • Try starting with an empty file and the auto setting: that seems to work for me (although there might be interactions with other settings). I think auto uses the surrounding context to figure out whether to add newlines, so you might get misleading results if your existing files already has empty lines where you don't want them. I would also start with emacs -Q -l /path/to/minimal/init.el with only the setting of org-blank-before-new-entry to make sure there are no interactions with other settings. I haven't tried with the nil setting yet.
    – NickD
    Dec 29, 2022 at 15:20
  • I just tried default auto setting but with no luck. I even deleted the file and it got recreated automatically but I'm getting the same result. Even if I create older entries, manually remove empty lines and then add entry with capure, it still makes them. Something is really strange here and I have no idea what to do.
    – Djole
    Dec 30, 2022 at 3:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.