Valentin Lab writes: >>> @@ -1216,6 +1259,13 @@ >>> (org-test-with-temp-text "* H\n:PROPERTIES:\n:key:\n:END:" >>> (org-indent-region (point-min) (point-max)) >>> (buffer-string))))) >>> + ;; ;; Indent property drawers according to `org-adapt-indentation'. >>> + ;; (let ((org-adapt-indentation 'headline-data)) >>> + ;; (should >>> + ;; (equal "* H\n :PROPERTIES:\n :key:\n :END:\n\ncontent2" >>> + ;; (org-test-with-temp-text "* H\n:PROPERTIES:\n:key:\n:END:\n\ncontent" >>> + ;; (org-indent-region (point-min) (point-max)) >>> + ;; (buffer-string))))) >> >> This test is commented. Is it intentional? > > My bad ! and an interesting talking point. I'm removing these commented > line in the upcoming patch. They were here (and inadvertently committed) > because while trying to test that my addition would not indent beyond > the headline data, I noticed that actually `org-adapt-indentation' set > to `headline-data' was actually indenting beyond headline data ! As I > don't want to break anything, I was left quite puzzled with what to do: > - I can fix this, but fixing this is for me subject to another > submission, and will touch behaviors that might be wanted, > - Not fixing this make me submitting a feature that carries what I see > like a "bug". > > But, is that a bug ? Here is the case: > > --8<---------------cut here---------------start------------->8--- > * H > :PROPERTIES: > :key: > :END: > > content > --8<---------------cut here---------------start------------->8--- > > Using `org-indent-region' on all the content, with > `org-adapt-indentation' set to `headline-data', will result to: > > --8<---------------cut here---------------start------------->8--- > * H > :PROPERTIES: > :key: > :END: > > content > --8<---------------cut here---------------start------------->8--- > > My issue is with the treatment of the 'content' line that is not > headline-data for me, and should not have been indented. Am I right in > my expectation ? Yes are right and we got a bug here. I am attaching the tentative fix. Bastien, I feel that the current implementation of `org--get-expected-indentation' is wrong since we introduced `org-adapt-indentation' 'headline-data value. AFAIU, it was done by you in e3b79ad2b. See the commit message in the patch below for the explanation why I think that something is going wrong. Am I missing something? Best, Ihor