emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Benjamin McMillan <mcmillanbb@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] A call of (org-end-of-meta-data t) goes too far in a heading with only whitespace
Date: Thu, 17 Oct 2024 20:55:20 +0900	[thread overview]
Message-ID: <CALo8A5VBoKAtwbf4++s4YOLePTLOfePhhU+EkiLDX3OZxHzBFw@mail.gmail.com> (raw)
In-Reply-To: <87jzedsfxx.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 2449 bytes --]

My understanding is that org-end-of-meta-data should put point at the start
of the 'real' contents of a heading. Meaning the first point where I might
start making notes under a heading.

This expectation isn't matched in the example I give (which is different
from the mentioned test). In my example, there is a heading, then several
blank lines, then another heading at the same level as the first. A call to
(end-of-meta-data t) goes all the way to the second heading, which surely
should not count as contents of the first heading. For me, expected
behavior is somewhere inside the contents of the heading.

I presume the test is to capture desired behavior when
org-blank-before-new-entry is true?
If that's correct, then when org-blank-before-new-entry is true, maybe a
call of (end-of-meta-data t) should skip to two lines after the metadata
(possibly adding lines if necessary?)
In contrast, I disable org-blank-before-new-entry, and want point to go
literally to the end of meta data, even if I have some blanks before
existing contents.

I apologize if this seems nitpicky, but the structured nature of an org
document allows for extremely accurate motion commands, and use of
end-of-meta-data is an important part of that.
(And apologies Ihor for resending this to you, I managed to not click
reply-all the first time around.)

On Sat, Oct 12, 2024 at 8:43 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Benjamin McMillan <mcmillanbb@gmail.com> writes:
>
> > Specifically, a call to (org-end-of-meta-data t) with point at the > on
> the
> > following tree will go all the way to the next heading.
> > In contrast, a call to just (org-end-of-meta-data), without the FULL
> flag,
> > will go to the beginning of heading content, as expected.
> > * >heading
> >
> >
> > * another heading
>
> This is intentional.
>
> We have a test:
>
>   ;; With option argument, skip empty lines, regular drawers and
>   ;; clocking lines.
>   (should
>    (org-test-with-temp-text "* Headline\n\nContents"
>      (org-end-of-meta-data t)
>      (looking-at "Contents")))
>
> May you please elaborate why you consider the current behavior to be a bug?
>
> --
> 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>
>

[-- Attachment #2: Type: text/html, Size: 3222 bytes --]

  reply	other threads:[~2024-10-17 11:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-05  6:52 [BUG] A call of (org-end-of-meta-data t) goes too far in a heading with only whitespace Benjamin McMillan
2024-10-12 11:45 ` Ihor Radchenko
2024-10-17 11:55   ` Benjamin McMillan [this message]
2024-10-17 17:58     ` Ihor Radchenko
2024-10-20  6:28       ` Benjamin McMillan
2024-10-20  9:05         ` Ihor Radchenko
2024-10-22 13:25           ` Benjamin McMillan
2024-10-22 17:28             ` 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=CALo8A5VBoKAtwbf4++s4YOLePTLOfePhhU+EkiLDX3OZxHzBFw@mail.gmail.com \
    --to=mcmillanbb@gmail.com \
    --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).