Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Org properties etc not accessible within blocks #32

Open
ComedyTomedy opened this issue Nov 3, 2021 · 2 comments
Open

Org properties etc not accessible within blocks #32

ComedyTomedy opened this issue Nov 3, 2021 · 2 comments

Comments

@ComedyTomedy
Copy link

ComedyTomedy commented Nov 3, 2021

Hello! Discovered this package today & love it.

My problem: Within a code block, when poly-org-mode is enabled, (org-entry-properties) returns nil. This seems to be the same for various other org-specific functions.

(My specific use case is calling org-babel-tangle, which seems to be broken by this, although I haven't tested extensively).

It would be nice to be able to execute code within the context of the "other" mode, perhaps via a macro (poly-with-org-mode ...), or if the issue affects other poly mode-pairings, (poly-with-outer-mode ...).

This issue may be related to other issues that are already on here - I looked but couldn't tell. Apologies if it's effectively a duplicate.

@vspinu
Copy link
Contributor

vspinu commented Nov 6, 2021

Within inner (non-org) modes there is no org mode. The workaround is to advice those functions which should be working across all modes to execute in the base org-mode buffer.

This is how it is done https://github.com/polymode/polymode/blob/54888d6c15249503e1a66da7bd7761a9eda9b075/polymode-core.el#L1434-L1436

@malcook
Copy link

malcook commented Apr 25, 2022

Glad to have found this discussion as it precisely addresses issue I was about to raise, namely that org-babel-demarcate-block does not work when called from inner mode. The solution is to

	     (pm-around-advice #'org-babel-demarcate-block #'polymode-with-current-base-buffer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants