emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data
@ 2023-06-08 10:46 Farblos
  2023-06-08 11:17 ` Ihor Radchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Farblos @ 2023-06-08 10:46 UTC (permalink / raw)
  To: emacs-orgmode

I like the idea of org-adapt-indentation being ´headline-data:

   When this variable is set to ‘headline-data’, Org only adapts the
   indentation of the data lines right below the headline, such as
   planning/clock lines and property/logbook drawers.

However, I find the resulting indentation behavior confusing.  Before
reporting bugs, I'd like to know where the headline data ends.  I'd
expect that the first blank (or whitespace-only?) line after a headline
would end the headline data.

Below are some examples where to I think headline data expands ("<==" 
pointing to point, underscore indicating trailing blanks).  Probably 
somebody could correct or confirm.

Thanks!

** Headline 1
<== in headline data ==

** Headline 2
    :properties:
    <== in headline data ==

** Headline 3
    :properties:
    :custom_id: foo
    :end:
    :logbook:
    clock: [2023-06-08 Thu 12:34]--[2023-06-08 Thu 12:36] =>  0:02
    :end:
    <== in headline data ==

** Headline 4
    :properties:

<== out of headline data

** Headline 5
    :properties:
___
<== out of headline data (previous line containing three blanks)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data
  2023-06-08 10:46 Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data Farblos
@ 2023-06-08 11:17 ` Ihor Radchenko
  2023-06-08 20:09   ` Farblos
  0 siblings, 1 reply; 9+ messages in thread
From: Ihor Radchenko @ 2023-06-08 11:17 UTC (permalink / raw)
  To: Farblos; +Cc: emacs-orgmode

Farblos <akfkqu.9df7rp@vodafonemail.de> writes:

> I like the idea of org-adapt-indentation being ´headline-data:
>
>    When this variable is set to ‘headline-data’, Org only adapts the
>    indentation of the data lines right below the headline, such as
>    planning/clock lines and property/logbook drawers.
>
> However, I find the resulting indentation behavior confusing.  Before
> reporting bugs, I'd like to know where the headline data ends.  I'd
> expect that the first blank (or whitespace-only?) line after a headline
> would end the headline data.

    (defun org--at-headline-data-p (&optional beg element)
      "Return non-nil when `point' or BEG is inside headline metadata.
    
    Metadata is planning line, properties drawer, logbook drawer right
    after property drawer, or clock log line immediately following
    properties drawer/planning line/ heading.

Hope it clarifies things.

Note that we had some bugs in this area in older Org versions.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data
  2023-06-08 11:17 ` Ihor Radchenko
@ 2023-06-08 20:09   ` Farblos
  2023-06-09  7:34     ` Ihor Radchenko
  0 siblings, 1 reply; 9+ messages in thread
From: Farblos @ 2023-06-08 20:09 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Thanks for the clarification.

On 2023-06-08  13:17, Ihor Radchenko wrote:

> Note that we had some bugs in this area in older Org versions.

I happen to have master from git://git.savannah.gnu.org/emacs.git
checked out here.  How recent is that w.r.t. "bleeding edge Org" from
git://git.savannah.gnu.org/emacs/org-mode.git?  I haven't found anything
on that in the Org FAQ https://orgmode.org/worg/org-faq.html.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data
  2023-06-08 20:09   ` Farblos
@ 2023-06-09  7:34     ` Ihor Radchenko
  2023-06-10 20:39       ` Jens Schmidt
  0 siblings, 1 reply; 9+ messages in thread
From: Ihor Radchenko @ 2023-06-09  7:34 UTC (permalink / raw)
  To: Farblos; +Cc: emacs-orgmode

Farblos <akfkqu.9df7rp@vodafonemail.de> writes:

>> Note that we had some bugs in this area in older Org versions.
>
> I happen to have master from git://git.savannah.gnu.org/emacs.git
> checked out here.  How recent is that w.r.t. "bleeding edge Org" from
> git://git.savannah.gnu.org/emacs/org-mode.git?  I haven't found anything
> on that in the Org FAQ https://orgmode.org/worg/org-faq.html.

Emacs master tracks the latest stable Org release.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data
  2023-06-09  7:34     ` Ihor Radchenko
@ 2023-06-10 20:39       ` Jens Schmidt
  2023-06-10 20:47         ` Farblos
  2023-06-11 10:21         ` Ihor Radchenko
  0 siblings, 2 replies; 9+ messages in thread
From: Jens Schmidt @ 2023-06-10 20:39 UTC (permalink / raw)
  To: Ihor Radchenko, Farblos; +Cc: emacs-orgmode

On 2023-06-09  09:34, Ihor Radchenko wrote:

> Emacs master tracks the latest stable Org release.

OK, so I cobbled up Org main with branch emacs-29.

./src/emacs -Q

M-x org-version

Org mode version 9.7-pre (release_9.6.6-408-g9082fa @ ...)

(setq org-adapt-indentation 'headline-data)

Paste the following into a new org file, headline A being the on the
first line:

-------------------- snip --------------------
** Headline A



** Headline B



** Headline C
    :properties:
-------------------- snip --------------------

Then try TAB on lines (my humble opinion in parentheses)

2: no indent (NOK)
3: no indent (OK)
6: indent (OK)
7: indent (NOK)
11: no indent (NOK)

I could try "fixing" that, but I'm not sure what is intended an what not.

WDYT?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data
  2023-06-10 20:39       ` Jens Schmidt
@ 2023-06-10 20:47         ` Farblos
  2023-06-10 20:59           ` Farblos
  2023-06-11 10:21         ` Ihor Radchenko
  1 sibling, 1 reply; 9+ messages in thread
From: Farblos @ 2023-06-10 20:47 UTC (permalink / raw)
  To: Jens Schmidt, Ihor Radchenko; +Cc: emacs-orgmode



On 2023-06-10  22:39, Jens Schmidt wrote:

> OK, so I cobbled up Org main with branch emacs-29.

Hang on, that test case is not really clean yet ... -Q disabled my 
load-path additions, of course ... will give it another try ...

Sorry.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data
  2023-06-10 20:47         ` Farblos
@ 2023-06-10 20:59           ` Farblos
  0 siblings, 0 replies; 9+ messages in thread
From: Farblos @ 2023-06-10 20:59 UTC (permalink / raw)
  To: Jens Schmidt, Ihor Radchenko; +Cc: emacs-orgmode

On 2023-06-10  22:47, Farblos wrote:

> Hang on, that test case is not really clean yet ... -Q disabled my 
> load-path additions, of course ... will give it another try ...

No, the test case is good and exactly as described in the mail before 
the previous one, even with "emacs -Q".

Thanks



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data
  2023-06-10 20:39       ` Jens Schmidt
  2023-06-10 20:47         ` Farblos
@ 2023-06-11 10:21         ` Ihor Radchenko
  2023-06-11 10:38           ` Farblos
  1 sibling, 1 reply; 9+ messages in thread
From: Ihor Radchenko @ 2023-06-11 10:21 UTC (permalink / raw)
  To: Jens Schmidt; +Cc: Farblos, emacs-orgmode

Jens Schmidt <jschmidt4gnu@vodafonemail.de> writes:

> (setq org-adapt-indentation 'headline-data)
>
> Paste the following into a new org file, headline A being the on the
> first line:
>
> -------------------- snip --------------------
> ** Headline A
>
>
>
> ** Headline B
>
>
>
> ** Headline C
>     :properties:
> -------------------- snip --------------------
>
> Then try TAB on lines (my humble opinion in parentheses)
>
> 2: no indent (NOK)

This is right:

`org-adapt-indentation' docstring states

    When this variable is set to headline-data, Org only adapts the
    indentation of the data lines right below the headline, such as
    planning/clock lines and property/logbook drawers.

Blank line is not a planning/clock/line/property drawer/logbook.
So, we do not indent.

> 6: indent (OK)
> 7: indent (NOK)

This is a bug. Fixed now, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=34082ff18

The logic in `org-indent-line' did not account for blank lines after heading.

> 11: no indent (NOK)

This is also OK. ":properties:", from Org's point of view is not a
property drawer, but a paragraph (there is no closing :end: and property
values inside). So, it is not a headline data.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data
  2023-06-11 10:21         ` Ihor Radchenko
@ 2023-06-11 10:38           ` Farblos
  0 siblings, 0 replies; 9+ messages in thread
From: Farblos @ 2023-06-11 10:38 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

On 2023-06-11  12:21, Ihor Radchenko wrote:

> This is a bug. Fixed now, on main.

Thanks!




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-06-14  8:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-08 10:46 Where does headline data end for the purpose of `org-adapt-indentation´ == ´headline-data Farblos
2023-06-08 11:17 ` Ihor Radchenko
2023-06-08 20:09   ` Farblos
2023-06-09  7:34     ` Ihor Radchenko
2023-06-10 20:39       ` Jens Schmidt
2023-06-10 20:47         ` Farblos
2023-06-10 20:59           ` Farblos
2023-06-11 10:21         ` Ihor Radchenko
2023-06-11 10:38           ` Farblos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).