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-entry-get returns nil after org-entry-put and save-buffer #40

Closed
ntharim opened this issue Dec 5, 2021 · 3 comments
Closed

org-entry-get returns nil after org-entry-put and save-buffer #40

ntharim opened this issue Dec 5, 2021 · 3 comments
Labels

Comments

@ntharim
Copy link

ntharim commented Dec 5, 2021

Describe the bug
In some cases, after running org-entry-put and save-buffer, org-entry-get returns nil instead the entry value.

From a clean Emacs config, this seems to happen only with org-eldoc enabled. In my full Doom Emacs however, disabling eldoc doesn't restore the expected behaviour, perhaps due to some modes or settings by Doom I haven't been able to narrow down.

Expected behavior
org-entry-get after org-entry-put and save-buffer always returns the correct entry value.

To Reproduce
Using fee5d07, start Emacs with org and org-eldoc loaded:

emacs -Q -L ~/.emacs.d/.local/straight/repos/org/lisp -L ~/.emacs.d/.local/straight/repos/org-contrib/lisp -l org
 -l org-eldoc

Create a test.org file with the following content:

:PROPERTIES:
:ID:       test
:END:
#+TITLE: Test

Test.

Run the following commands:

(goto-char (point-min))
(org-entry-put nil "ID" "test")
(save-buffer)
(org-entry-get nil "ID")

(org-entry-get nil "ID") returns nil instead of "test".

@ntharim ntharim added the bug label Dec 5, 2021
yantar92 pushed a commit that referenced this issue Dec 5, 2021
* lisp/org-element.el (org-element--cache-sensitive-re): Make proprety
drawer lines sensitive.
(org-element--cache-before-change): Prioritise 'org-data warning.
(org-element--cache-for-removal): Make sensitive edits inside cache
gap right after org-data re-parse the org-data.  Make sensitive
top-section edits re-parse org-data.

The specific error has been reported in
#40
The recepy involves loading org-contrib:
1. emacs -Q -L ~/.emacs.d/.local/straight/repos/org/lisp -L ~/.emacs.d/.local/straight/repos/org-contrib/lisp -l org
 -l org-eldoc
 2. Create a test.org file with the following content:
 :PROPERTIES:
:ID:       test
:END:

Test.
3.
(goto-char (point-min))
(org-entry-put nil "ID" "test")
(save-buffer)
(org-entry-get nil "ID")
Return value is nil, while should be "test"
@yantar92
Copy link
Owner

yantar92 commented Dec 5, 2021

Thanks for reporting! Can you update and check again?

@ntharim
Copy link
Author

ntharim commented Dec 5, 2021

Yes it works perfectly now. Thanks for fixing it so quickly!

Would be great if you could push this to the main Org branch as well. I first encountered this issue there.

Thank you for all your amazing work on this branch and getting it merged into main!

@ntharim ntharim closed this as completed Dec 5, 2021
@yantar92
Copy link
Owner

yantar92 commented Dec 5, 2021

Would be great if you could push this to the main Org branch as well. I first encountered this issue there.

I plan to run it for some time locally before pushing. Just in case if there are unintended side-effects. This change was not trivial.

yantar92 pushed a commit that referenced this issue Dec 6, 2021
* lisp/org-element.el (org-element--cache-sensitive-re): Make proprety
drawer lines sensitive.
(org-element--cache-before-change): Prioritise 'org-data warning.
(org-element--cache-for-removal): Make sensitive edits inside cache
gap right after org-data re-parse the org-data.  Make sensitive
top-section edits re-parse org-data.

The specific error has been reported in
#40
The recepy involves loading org-contrib:
1. emacs -Q -L ~/.emacs.d/.local/straight/repos/org/lisp -L ~/.emacs.d/.local/straight/repos/org-contrib/lisp -l org
 -l org-eldoc
 2. Create a test.org file with the following content:
 :PROPERTIES:
:ID:       test
:END:

Test.
3.
(goto-char (point-min))
(org-entry-put nil "ID" "test")
(save-buffer)
(org-entry-get nil "ID")
Return value is nil, while should be "test"
raxod502 pushed a commit to emacs-straight/org-mode that referenced this issue Dec 9, 2021
* lisp/org-element.el (org-element--cache-sensitive-re): Make proprety
drawer lines sensitive.
(org-element--cache-for-removal): Make sensitive edits inside cache
gap right after org-data re-parse the org-data.  Make sensitive
top-section edits re-parse org-data.

The specific error has been reported in
yantar92/org#40
The recepy involves loading org-contrib:
1. emacs -Q -L ~/.emacs.d/.local/straight/repos/org/lisp -L ~/.emacs.d/.local/straight/repos/org-contrib/lisp -l org
 -l org-eldoc
 2. Create a test.org file with the following content:
 :PROPERTIES:
:ID:       test
:END:

Test.
3.
(goto-char (point-min))
(org-entry-put nil "ID" "test")
(save-buffer)
(org-entry-get nil "ID")
Return value is nil, while should be "test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants