* [BUG] Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Org Agenda*> (org-agenda-mode) [9.7.11 (release_9.7.11 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)]
@ 2025-01-21 20:26 Mark Barton
2025-01-21 20:48 ` Ihor Radchenko
0 siblings, 1 reply; 4+ messages in thread
From: Mark Barton @ 2025-01-21 20:26 UTC (permalink / raw)
To: Org Mode List
--text follows this line--
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.
------------------------------------------------------------------------
I had tried modifying Org agenda to display the repeater in tasks as Wai
Hon's Blog documented a few weeks ago:
https://whhone.com/posts/org-agenda-repeated-tasks/
Below is the code that causes the org-element warning:
(defun my/org-agenda-repeater ()
"The repeater shown in org-agenda-prefix for agenda."
(if (org-before-first-heading-p)
"-------" ; fill the time grid
(format "%5s: " (or (org-get-repeat) ""))))
;; Add `my/org-agenda-repeater' to the agenda prefix.
(setcdr (assoc 'agenda org-agenda-prefix-format)
" %i %-12:c%?-12t%s%(my/org-agenda-repeater)")
Emacs : GNU Emacs 31.0.50 (build 1, x86_64-apple-darwin24.2.0, NS appkit-2575.30 Version 15.2 (Build 24C101))
of 2025-01-20
Package: Org mode version 9.7.11 (release_9.7.11 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)
For now I just commented out the code that attempts to add the repeater
to Org Agenda, but it is easy for me to reproduce if you need further information.
Thanks,
Mark Barton
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [BUG] Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Org Agenda*> (org-agenda-mode) [9.7.11 (release_9.7.11 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)]
2025-01-21 20:26 [BUG] Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Org Agenda*> (org-agenda-mode) [9.7.11 (release_9.7.11 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)] Mark Barton
@ 2025-01-21 20:48 ` Ihor Radchenko
2025-01-21 23:06 ` Mark Barton
0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2025-01-21 20:48 UTC (permalink / raw)
To: Mark Barton; +Cc: Org Mode List
Mark Barton <mbarton98@gmail.com> writes:
> I had tried modifying Org agenda to display the repeater in tasks as Wai
> Hon's Blog documented a few weeks ago:
> https://whhone.com/posts/org-agenda-repeated-tasks/
>
> Below is the code that causes the org-element warning:
>
> (defun my/org-agenda-repeater ()
> "The repeater shown in org-agenda-prefix for agenda."
> (if (org-before-first-heading-p)
> "-------" ; fill the time grid
> (format "%5s: " (or (org-get-repeat) ""))))
>
> ;; Add `my/org-agenda-repeater' to the agenda prefix.
> (setcdr (assoc 'agenda org-agenda-prefix-format)
> " %i %-12:c%?-12t%s%(my/org-agenda-repeater)")
This code looks all right - org-agenda-prefix-format placeholders are
evaluated with current buffer being Org buffer (normally).
May you try to run M-x debug-on-entry RET display-warning RET and
try triggering the warning? Then, you will see a backtrace with the full
information about where the warning is triggered.
(you can later disable the debugger via M-x cancel-debug-on-entry RET RET)
--
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] Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Org Agenda*> (org-agenda-mode) [9.7.11 (release_9.7.11 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)]
2025-01-21 20:48 ` Ihor Radchenko
@ 2025-01-21 23:06 ` Mark Barton
2025-01-22 1:09 ` Mark Barton
0 siblings, 1 reply; 4+ messages in thread
From: Mark Barton @ 2025-01-21 23:06 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Org Mode List
[-- Attachment #1: Type: text/plain, Size: 902 bytes --]
> On Jan 21, 2025, at 12:48 PM, Ihor Radchenko <yantar92@posteo.net> wrote:
>
> May you try to run M-x debug-on-entry RET display-warning RET and
> try triggering the warning? Then, you will see a backtrace with the full
> information about where the warning is triggered.
>
> (you can later disable the debugger via M-x cancel-debug-on-entry RET RET)
I jinxed it when I said it was easy to reproduce. Because now even if I put that code back in, it does not display the warning for org-element that has been happening for days. The other things that changed are the org files, but the diffs look like normal marking tasks done and updating repeats. The other thing I ran this morning is (native-compile-prune-cache). I would not expect that to be the source.
Please close this out and I will file a new report if it happens again with the debug backtrace.
Thanks,
Mark Barton
[-- Attachment #2: Type: text/html, Size: 4093 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [BUG] Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Org Agenda*> (org-agenda-mode) [9.7.11 (release_9.7.11 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)]
2025-01-21 23:06 ` Mark Barton
@ 2025-01-22 1:09 ` Mark Barton
0 siblings, 0 replies; 4+ messages in thread
From: Mark Barton @ 2025-01-22 1:09 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Org Mode List
[-- Attachment #1: Type: text/plain, Size: 2417 bytes --]
> On Jan 21, 2025, at 3:06 PM, Mark Barton <mbarton98@gmail.com> wrote:
>
>
>
>> On Jan 21, 2025, at 12:48 PM, Ihor Radchenko <yantar92@posteo.net> wrote:
>>
>> May you try to run M-x debug-on-entry RET display-warning RET and
>> try triggering the warning? Then, you will see a backtrace with the full
>> information about where the warning is triggered.
>>
>> (you can later disable the debugger via M-x cancel-debug-on-entry RET RET)
>
> I jinxed it when I said it was easy to reproduce. Because now even if I put that code back in, it does not display the warning for org-element that has been happening for days. The other things that changed are the org files, but the diffs look like normal marking tasks done and updating repeats. The other thing I ran this morning is (native-compile-prune-cache). I would not expect that to be the source.
>
> Please close this out and I will file a new report if it happens again with the debug backtrace.
>
> Thanks,
>
> Mark Barton
Got it to occur in org-agenda-log-mode C-c a a l
Debugger entered--entering a function:
* org-element-at-point()
org--collect-keywords-1(("SETUPFILE" "FILETAGS" "TAGS") ("ARCHIVE" "CATEGORY" "COLUMNS" "PRIORITIES") nil ("/Users/bartm002/Documents/org/Work_Projects.org") nil)
org-collect-keywords(("FILETAGS" "TAGS") ("ARCHIVE" "CATEGORY" "COLUMNS" "PRIORITIES"))
org-set-regexps-and-options(tags-only)
org-agenda-prepare-buffers(("/Users/bartm002/Documents/org/Work_Projects.org" "/Users/bartm002/Documents/org/Bookmarks.org" "/Users/bartm002/Documents/org/DailyPlans.org" "/Users/bartm002/Documents/org/Personal.org" "/Users/bartm002/Documents/org/Today.org" "/Users/bartm002/Documents/org/diary.org" "/Users/bartm002/Documents/org/goals.org" "/Users/bartm002/Documents/org/python_notes.org" "/Users/bartm002/Documents/org/refile.org"))
org-agenda-prepare("Day/Week")
org-agenda-list(nil nil week nil)
eval((org-agenda-list 'nil nil 'week nil) t)
#f(compiled-function () #<bytecode 0x84c7cc8def533>)()
funcall(#f(compiled-function () #<bytecode 0x84c7cc8def533>))
(let nil (funcall '#f(compiled-function () #<bytecode 0x84c7cc8def533>)))
eval((let nil (funcall '#f(compiled-function () #<bytecode 0x84c7cc8def533>))))
org-agenda-redo()
org-agenda-log-mode(nil)
funcall-interactively(org-agenda-log-mode nil)
command-execute(org-agenda-log-mode)
[-- Attachment #2: Type: text/html, Size: 6192 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-22 1:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-21 20:26 [BUG] Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *Org Agenda*> (org-agenda-mode) [9.7.11 (release_9.7.11 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)] Mark Barton
2025-01-21 20:48 ` Ihor Radchenko
2025-01-21 23:06 ` Mark Barton
2025-01-22 1:09 ` Mark Barton
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).