emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Tom Alexander" <tom@fizz.buzz>
To: "Ihor Radchenko" <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Clarification on blank lines following list items
Date: Sun, 20 Aug 2023 21:56:48 -0400	[thread overview]
Message-ID: <1c833eb8-c556-437b-ac5b-be360ebcc869@app.fastmail.com> (raw)
In-Reply-To: <87bkf3o211.fsf@localhost>

Thank you so much for explaining all of that! There is some good information there I was missing. I think the most important bit I was missing is the post-blank stuff. I was only looking at begin->end but I think digging into the post-blank is what makes this consistent.

I've got 2 separate questions:

1. Is the following statement true? "Two elements can count the same character in their post-blank?"
I am seeing dual-ownership of the post-blank in the examples below, but at the same time if I put a plain-list inside a footnote definition, the footnote definition ends up with sole custody of the post-blank.

2. I'm still not sure about some behavior I'm seeing. I think it would be easiest to see if we focus on exactly 1 blank line:

```
1. bar
2. baz
       <---- this blank line here
ipsum
```

In this example, the blank line gets counted in the post-blank for the plain-list but not for the item:
```
plain-list: post-blank 1 | begin 1 end 16 | contents-begin 1 contents-end 15
    item: post-blank 0 | begin 1 end 8 | contents-begin 4 contents-end 8
        paragraph: post-blank 0 | begin 4 end 8 | contents-begin 4 contents-end 8
    item: post-blank 0 | begin 8 end 15 | contents-begin 11 contents-end 15
        paragraph: post-blank 0 | begin 11 end 15 | contents-begin 11 contents-end 15
paragraph: post-blank 0 | begin 16 end 22 | contents-begin 16 contents-end 22
```

but if we take that plain-list and nest it inside another plain-list:
```
1. foo
   1. bar
   2. baz
           <---- this blank line here
2. lorem
ipsum
```

The blank line gets counted as a post-blank for both the item "foo" and the item "baz":
```
plain-list: post-blank 0 | begin 1 end 38 | contents-begin 1 contents-end 38
    item: post-blank 1 | begin 1 end 29 | contents-begin 4 contents-end 28
        paragraph: post-blank 0 | begin 4 end 8 | contents-begin 4 contents-end 8
        plain-list: post-blank 0 | begin 8 end 29 | contents-begin 8 contents-end 29
            item: post-blank 0 | begin 8 end 18 | contents-begin 14 contents-end 18
                paragraph: post-blank 0 | begin 14 end 18 | contents-begin 14 contents-end 18
            item: post-blank 1 | begin 18 end 29 | contents-begin 24 contents-end 28
                paragraph: post-blank 0 | begin 24 end 28 | contents-begin 24 contents-end 28
    item: post-blank 0 | begin 29 end 38 | contents-begin 32 contents-end 38
        paragraph: post-blank 0 | begin 32 end 38 | contents-begin 32 contents-end 38
paragraph: post-blank 0 | begin 38 end 44 | contents-begin 38 contents-end 44
```

Meaning the post-blank did this movement:
```
plain-list: post-blank 0
    item: post-blank 1   <---<----<----<-\
        paragraph: post-blank 0          |
        plain-list: post-blank 0 >---->--|
            item: post-blank 0           |
                paragraph: post-blank 0  |
            item: post-blank 1   <---<---/
                paragraph: post-blank 0
    item: post-blank 0
        paragraph: post-blank 0
paragraph: post-blank 0
```


Question ---> So why is the item "baz" gaining a post-blank instead of the inner plain-list (bar baz) keeping that post-blank?

I would expect it to instead be:
```
plain-list: post-blank 0
    item: post-blank 1
        paragraph: post-blank 0
here -> plain-list: post-blank 1
            item: post-blank 0
                paragraph: post-blank 0
not here -> item: post-blank 0
                paragraph: post-blank 0
    item: post-blank 0
        paragraph: post-blank 0
paragraph: post-blank 0
```

I re-did both test cases using greater blocks and lesser blocks instead of paragraphs to make sure it wasn't that historical exception at the end of your email, and the post-blank behavior was exactly the same.


-- 
Tom Alexander


  reply	other threads:[~2023-08-21  1:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-19  5:30 Clarification on blank lines following list items Tom Alexander
2023-08-19  8:43 ` Ihor Radchenko
2023-08-21  1:56   ` Tom Alexander [this message]
2023-08-22  7:47     ` Ihor Radchenko
2023-08-22  8:26       ` Ihor Radchenko
2023-08-24 18:46         ` Tom Alexander
2023-09-16 11:26   ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c833eb8-c556-437b-ac5b-be360ebcc869@app.fastmail.com \
    --to=tom@fizz.buzz \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).