* [BUG] Org Element Api: :begin and :end are missing [9.7.13 (9.7.13-8566bc @ /home/arne/.emacs.d/elpa/org-9.7.13/)]
@ 2024-12-29 10:45 Dr. Arne Babenhauserheide
2024-12-29 10:51 ` Ihor Radchenko
0 siblings, 1 reply; 4+ messages in thread
From: Dr. Arne Babenhauserheide @ 2024-12-29 10:45 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See
https://orgmode.org/manual/Feedback.html#Feedback
Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------
In the Org Element API article describes that all elements share :begin
and :end:
https://orgmode.org/worg/dev/org-element-api.html#fnr.1
I don’t know where that changed, but I found that nowadays I have to use
`org-element-contents-begin' and `org-element-contents-begin' to get
the beginning and end of an element.
(this had broken the new article listing on my website for quite a while
until I now went to find the problem)
Best wishes,
Arne
Emacs : GNU Emacs 30.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0)
Package: Org mode version 9.7.13 (9.7.13-8566bc @ /home/arne/.emacs.d/elpa/org-9.7.13/)
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [BUG] Org Element Api: :begin and :end are missing [9.7.13 (9.7.13-8566bc @ /home/arne/.emacs.d/elpa/org-9.7.13/)]
2024-12-29 10:45 [BUG] Org Element Api: :begin and :end are missing [9.7.13 (9.7.13-8566bc @ /home/arne/.emacs.d/elpa/org-9.7.13/)] Dr. Arne Babenhauserheide
@ 2024-12-29 10:51 ` Ihor Radchenko
2024-12-29 13:10 ` Dr. Arne Babenhauserheide
0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2024-12-29 10:51 UTC (permalink / raw)
To: Dr. Arne Babenhauserheide; +Cc: emacs-orgmode
"Dr. Arne Babenhauserheide" <arne_bab@web.de> writes:
> In the Org Element API article describes that all elements share :begin
> and :end:
> https://orgmode.org/worg/dev/org-element-api.html#fnr.1
Yes.
> I don’t know where that changed, but I found that nowadays I have to use
> `org-element-contents-begin' and `org-element-contents-begin' to get
> the beginning and end of an element.
Why? What's wrong with `org-element-begin' and `org-element-end'?
--
Ihor Radchenko // yantar92,
Org mode maintainer,
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] 4+ messages in thread
* Re: [BUG] Org Element Api: :begin and :end are missing [9.7.13 (9.7.13-8566bc @ /home/arne/.emacs.d/elpa/org-9.7.13/)]
2024-12-29 10:51 ` Ihor Radchenko
@ 2024-12-29 13:10 ` Dr. Arne Babenhauserheide
2024-12-29 13:16 ` Ihor Radchenko
0 siblings, 1 reply; 4+ messages in thread
From: Dr. Arne Babenhauserheide @ 2024-12-29 13:10 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2196 bytes --]
Ihor Radchenko <yantar92@posteo.net> writes:
> "Dr. Arne Babenhauserheide" <arne_bab@web.de> writes:
>
>> In the Org Element API article describes that all elements share :begin
>> and :end:
>> https://orgmode.org/worg/dev/org-element-api.html#fnr.1
>
> Yes.
>
>> I don’t know where that changed, but I found that nowadays I have to use
>> `org-element-contents-begin' and `org-element-contents-begin' to get
>> the beginning and end of an element.
>
> Why? What's wrong with `org-element-begin' and `org-element-end'?
I didn’t know that I could also use these ☺
What’s wrong is only that I had to fix showing the first paragraph of
articles on my website with this change:¹
diff -r 67cc09b71bed -r a7c3f1ff95a6 index.org.in
--- a/index.org.in Fri Dec 27 01:31:27 2024 +0100
+++ b/index.org.in Sun Dec 29 11:50:14 2024 +0100
@@ -259,6 +259,6 @@
(when (re-search-forward "^[ \t]*#\\+title:[ \t]*\\(.*\\)$" nil t)
(match-string 1))))
(org-elements (org-element-parse-buffer))
- (begin (plist-get (car (cdr (assoc 'paragraph (org-element-contents (nth 2 org-elements))))) ':begin))
- (end (plist-get (car (cdr (assoc 'paragraph (org-element-contents (nth 2 org-elements))))) ':end))
+ (begin (org-element-contents-begin (assoc 'paragraph (org-element-contents (nth 2 org-elements)))))
+ (end (org-element-contents-end (assoc 'paragraph (org-element-contents (nth 2 org-elements)))))
(first-paragraph (if (and begin end) (buffer-substring begin end) "")))
But https://orgmode.org/worg/dev/org-element-api.html#fnr.1 claims that
it should still be working.
¹ https://hg.sr.ht/~arnebab/draketo/browse/index.org.in?rev=tip#L222
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [BUG] Org Element Api: :begin and :end are missing [9.7.13 (9.7.13-8566bc @ /home/arne/.emacs.d/elpa/org-9.7.13/)]
2024-12-29 13:10 ` Dr. Arne Babenhauserheide
@ 2024-12-29 13:16 ` Ihor Radchenko
0 siblings, 0 replies; 4+ messages in thread
From: Ihor Radchenko @ 2024-12-29 13:16 UTC (permalink / raw)
To: Dr. Arne Babenhauserheide; +Cc: emacs-orgmode
"Dr. Arne Babenhauserheide" <arne_bab@web.de> writes:
>> Why? What's wrong with `org-element-begin' and `org-element-end'?
>
> I didn’t know that I could also use these ☺
>
> What’s wrong is only that I had to fix showing the first paragraph of
> articles on my website with this change:¹
> - (begin (plist-get (car (cdr (assoc 'paragraph (org-element-contents
> (nth 2 org-elements))))) ':begin))
> ...
> But https://orgmode.org/worg/dev/org-element-api.html#fnr.1 claims that
> it should still be working.
I do not see anything mentioning plist on that page. That WORG page
suggests using org-element-property.
Using plist-get is abusing implementation details that have been
changed. See https://orgmode.org/Changes.html#org92f24b2
Not a bug.
Canceled.
--
Ihor Radchenko // yantar92,
Org mode maintainer,
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] 4+ messages in thread
end of thread, other threads:[~2024-12-29 13:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-29 10:45 [BUG] Org Element Api: :begin and :end are missing [9.7.13 (9.7.13-8566bc @ /home/arne/.emacs.d/elpa/org-9.7.13/)] Dr. Arne Babenhauserheide
2024-12-29 10:51 ` Ihor Radchenko
2024-12-29 13:10 ` Dr. Arne Babenhauserheide
2024-12-29 13:16 ` 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).