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-element-at-point’ cannot be used in non-Org buffer #16575

Closed
tkossak opened this issue Sep 13, 2024 · 9 comments
Closed

‘org-element-at-point’ cannot be used in non-Org buffer #16575

tkossak opened this issue Sep 13, 2024 · 9 comments

Comments

@tkossak
Copy link

tkossak commented Sep 13, 2024

Description :octocat:

When I press SPC j i (command spacemacs/helm-jump-in-buffer) I get multiple errors:
⛔ Warning (org-element): ‘org-element-at-point’ cannot be used in non-Org buffer #<buffer *helm org inbuffer*> (helm-major-mode)

Reproduction guide 🪲

  • create file test.org with content:
* heading1
blabla
  • you need to also have (setq helm-org-format-outline-path nil) in your dotspacemacs/user-config in .spacemacs file
  • Start Emacs and open test.org file
  • press SPC j i

Observed behaviour: 👀 💔

  • the error appears in separate buffer

Expected behaviour: ❤️ 😄

  • there should be no error

System Info 💻

  • OS: gnu/linux
  • Emacs: 29.4
  • Spacemacs: 0.999.0
  • Spacemacs branch: develop (rev. 2cb3531)
  • Graphic display: t
  • Running in daemon: nil
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(emacs-lisp helm org treemacs)
  • System configuration features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
@tkossak
Copy link
Author

tkossak commented Sep 13, 2024

I found out that the problem is caused by (setq helm-org-format-outline-path nil) in my user-config.

@smile13241324 smile13241324 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2024
@tkossak
Copy link
Author

tkossak commented Sep 16, 2024

@smile13241324 what do you mean "not planned" - the bug won't be fixed?

@fnussbaum
Copy link
Contributor

I cannot reproduce this. For me your reproduction steps succeed without errors or warnings for both values of helm-org-format-outline-path. Are your packages up to date?

@smile13241324
Copy link
Collaborator

Sorry @tkossak I have understood your last comment that this was a user config error. If not I will reopen this issue

@smile13241324 smile13241324 reopened this Sep 16, 2024
@tkossak
Copy link
Author

tkossak commented Sep 16, 2024

I just tried to reproduce it with new spacemacs installation:

mv ~/.emacs.d ~/.emacs.d.old
mv ~/.spacemacs ~/.spacemacs.old

git clone --recursive https://github.com/syl20bnr/spacemacs ~/.emacs.d

Now copy my sample dotfile to ~/.spacemacs. Only few lines changed from default dotfile - I added org layer, removed multi cursor layer and added these 2 lines:

  (setq helm-org-format-outline-path nil)
  (setq org-startup-indented 't)

Create sample org file (eg like in first post), start Spacemacs and open the file. Press SPC j i, result:
image

When I comment out the line (setq helm-org-format-outline-path nil) then it works without any errors. But it also works when I comment out only the second line (setq org-startup-indented 't), so not sure what is the culprit here.

@fnussbaum
Copy link
Contributor

fnussbaum commented Sep 16, 2024

This seems to be a problem upstream in https://github.com/emacs-helm/helm-org, and should be reported there.
As a workaround it should be relatively safe to ignore this warning with something like:

  (add-to-list 'warning-suppress-types 'org-element-parser)

(These warnings will still get logged to the buffer, but they will not pop up anymore.)

@tkossak
Copy link
Author

tkossak commented Sep 17, 2024

Thank you. I posted it in helm-org github.
The silence trick doesn't work properly for me. I added it to my spacemacs/user-config function, and now when I press SPC j i I don't get dialog (to jump to specific heading) at all. Instead I get error in status bar:
Error running timer ‘org-indent-initialize-agent’: (wrong-type-argument listp org-element-parser)

For now I got rid of the option (setq org-startup-indented 't) from my dotfile.

@tkossak tkossak closed this as completed Sep 17, 2024
@fnussbaum
Copy link
Contributor

This should work:

(add-to-list 'warning-suppress-types '(org-element org-element-parser))

@tkossak
Copy link
Author

tkossak commented Sep 18, 2024

This should work:

(add-to-list 'warning-suppress-types '(org-element org-element-parser))

Thank you very much, this works :)

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