emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* continuing about orgalist org-element interaction
@ 2024-06-19 16:07 Rustom Mody
  2024-06-19 16:43 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Rustom Mody @ 2024-06-19 16:07 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Nicolas Goaziou

I guess in a way the other thread (Sub: orgalist send bug) is done and
orgalist in the new version is usable enough for me that I can live
with the warning.

But I was troubled with the possibility of lots of load path shadows
so I spent some time cleaning up. [In any case since emacs had got
upgraded recently, things like use-package are now in emacs so they
had to be removed. So it's good I did that]

But I felt like still poking around seeing if I could see what's the issue.

I figured its these 5 lines at the start of org-element-at-point

(unless (derived-mode-p 'org-mode)
         (display-warning
          '(org-element org-element-parser)
          (format-message
           "`org-element-at-point' cannot be used in non-Org buffer %S (%s)"
         (current-buffer) major-mode)))

Now the current buffer (in my case) is text-mode, obviously not org
mode so why that check??

Commenting out those lines the error message has gone. (And of course
its still working)

[I also checked that the corresponding send from ORGTBL does NOT
invoke org-element-at-point]

Now obviously I dont understand enough about the innards of org to
make any suggestion to remove as Ive currently tried.
But still there is the question (really for Nicolas)
What is the meaning of ensuring that its org mode and warning
otherwise when orgalist (like orgtbl) are meant specifically for non
org buffers?

Thanks
Rusi


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: continuing about orgalist org-element interaction
  2024-06-19 16:07 continuing about orgalist org-element interaction Rustom Mody
@ 2024-06-19 16:43 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-06-19 16:43 UTC (permalink / raw)
  To: Rustom Mody; +Cc: emacs-orgmode, Nicolas Goaziou

Rustom Mody <rustompmody@gmail.com> writes:

> I figured its these 5 lines at the start of org-element-at-point
>
> (unless (derived-mode-p 'org-mode)
>          (display-warning
>           '(org-element org-element-parser)
>           (format-message
>            "`org-element-at-point' cannot be used in non-Org buffer %S (%s)"
>          (current-buffer) major-mode)))
>
> Now the current buffer (in my case) is text-mode, obviously not org
> mode so why that check??

That warning says that you should not call `org-element-at-point' (Org
parser) in non-Org buffers. That may lead to unpredictable results.

Something in your Emacs is doing that.
You may find out what by doing something like
M-x debug-on-entry RET org-element-at-point

> Commenting out those lines the error message has gone. (And of course
> its still working)

So, you are lucky. May even disable that warning.

> Now obviously I dont understand enough about the innards of org to
> make any suggestion to remove as Ive currently tried.
> But still there is the question (really for Nicolas)
> What is the meaning of ensuring that its org mode and warning
> otherwise when orgalist (like orgtbl) are meant specifically for non
> org buffers?

`org-element-at-point' has nothing to do with orgalist.
It is a function defined in Org mode.

-- 
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-06-19 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-19 16:07 continuing about orgalist org-element interaction Rustom Mody
2024-06-19 16:43 ` 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).