* [BUG] A call of (org-end-of-meta-data t) goes too far in a heading with only whitespace
@ 2024-10-05 6:52 Benjamin McMillan
2024-10-12 11:45 ` Ihor Radchenko
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin McMillan @ 2024-10-05 6:52 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 778 bytes --]
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
The issue arises from the code for skipping clock lines, which does so by
checking if point is looking at (concat "[ \t]*$" "\\|" org-clock-line-re).
I'm not sure of the intention of the first alternative, the "[ \t]*$", but
it matches an empty line, and so the loop advances point to the next line,
until reaching the next heading in the case above.
Removing that from the regexp appears to fix the issue.
If this change is fine, then I am happy to provide a patch.
Thanks,
Ben
[-- Attachment #2: Type: text/html, Size: 937 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [BUG] A call of (org-end-of-meta-data t) goes too far in a heading with only whitespace
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
0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-10-12 11:45 UTC (permalink / raw)
To: Benjamin McMillan; +Cc: emacs-orgmode
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-12 11:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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).