jxq0 / org-tidy

🧹 An Emacs minor mode to automatically tidy org-mode property drawers
GNU General Public License v3.0
98 stars 7 forks source link

Keep the newline that follows a drawer #12

Open alecigne opened 10 months ago

alecigne commented 10 months ago

Hi,

First of all, thank you for this mode! It is useful, especially in combination with org-present.

Unless I'm mistaken, org-tidy doesn't keep the newline below a drawer. For example, this:

* Origines
:PROPERTIES:
:CREATED:  [2023-12-09 Sat 12:15]
:END:

- Né dans les années 1970 au laboratoire d'intelligence artificielle
  du MIT.

...will be displayed like this after calling org-tidy-mode:

* Origines #
- Né dans les années 1970 au laboratoire d'intelligence artificielle
  du MIT.

I'd prefer the newline to be kept, to obtain this:

* Origines #

- Né dans les années 1970 au laboratoire d'intelligence artificielle
  du MIT.

Is it possible with the current version of org-tidy ? If so, I'd be happy to add it to the README since I think some people might have the same question.

Thank you,

Anthony

Cletip commented 10 months ago

Exactly the same issue that I want to open 3 days after you :)

lyndhurst commented 4 months ago

Same issue for me. I hope it gets some attention :)

@Cletip, I see made a PR to solve this issue. So thanks for your time.

I tried to install your fork on Doom Emacs, but I see no difference. I am fairly new to Emacs and elisp, but looking at the code, I can see your changes have to do with overlay.

I have the option org-tidy-protect-overlay set to nil, do you have any idea if that could be the reason why it does not work for me ?