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

Losing org text properties #13

Open
srnnkls opened this issue May 22, 2019 · 3 comments
Open

Losing org text properties #13

srnnkls opened this issue May 22, 2019 · 3 comments

Comments

@srnnkls
Copy link

srnnkls commented May 22, 2019

I made the observation that org text properties are somewhat falling apart inside chunks after edititing in innermodes. E.g. i cannot check for org-in-src-block-p anymore (that function internally relies on (get-char-property). Is there anything I can do to make sure that text properties are reliably moved to the respective innermodes (ess and elisp in my case). My current workaround is a custom version of that predicate that falls back to org-element-context and org-element-type.

@vspinu
Copy link
Contributor

vspinu commented May 22, 2019

Text properties need not be moved. They are shared. The problem is most likely due to the fact that properties are no longer applied as they should. Probably in post-command-hook or after-change-functions or somewhere else. I couldn't find the place where org applies the src-block property on a quick search. Could you figure that out please? I will pick it up from there. Traveling till mid next week though.

@srnnkls
Copy link
Author

srnnkls commented May 23, 2019

Thank you. I'm pretty new to emacs and it is not fully clear to me when and where text properties are applied. I will dig into to the org codebase to find out. My first guess is that the src-block property is applied during or just before fontification.

In general, the canonical way to check context in org-files today seems to be using org-element anyway. So, org-in-src-block-p seems outdated. It would be nice, however, to have backward compatibility here.

@ghost
Copy link

ghost commented Feb 18, 2021

@vspinu https://github.com/bzg/org-mode/blob/7a9a8a56af4cf02abc1fb86eda96f0c7dc6b0348/lisp/org.el#L5288
it seems that text property is not applied if org-src-fontify-natively is nil

also org-keyword-properties need to be shared with the buffers since it is buffer local (shouldn't any buffer local variable set by org be shared?)

edit1:
so it was disabled by #6 ..mh

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

2 participants