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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

`SPC m` undefined in org-mode #8106

Open
Troyciv opened this Issue Jan 4, 2017 · 16 comments

Comments

Projects
None yet
8 participants
@Troyciv

Troyciv commented Jan 4, 2017

Description :octocat:

In org-mode: when having a # SETUPFILE: anyfile line in the document, the SPC m entry gets lost, as well as the , major-mode leader key.

Reproduction guide 馃悶

  • Start Emacs
  • only org layer enabled
  • create a new file test.org that contains the followed:
# TITLE: test
# SETUPFILE: anyfile.org
* org test
  • SPC f s
  • SPC b d
  • SPC f f open test.org
  • press , or SPC m

Observed behaviour: 馃憖 馃挃

when , pressed: Can't find

when SPC m is pressed: SPC m is undefined

Expected behaviour: 鉂わ笍 馃槃

  • open the org mode command menue

System Info 馃捇

  • OS: gnu/linux
  • Emacs: 24.5.1
  • Spacemacs: 0.200.7
  • Spacemacs branch: master (rev. c2774bc)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(org)

Backtrace 馃惥

<<BACKTRACE IF RELEVANT>>
@smile13241324

This comment has been minimized.

Contributor

smile13241324 commented Jan 7, 2017

Tried to reproduce this on Linux with

  • Emacs 25.1.1
  • Spacemacs 0.200.7
  • On master as well as on develop

Unfortunately I did not encounter any errors while I was working with your test file.
Could you update your Emacs version to 25.1.1 and check whether the issue persists?

@j-martin

This comment has been minimized.

Contributor

j-martin commented Jan 11, 2017

Confirming I have the same issue with 24.5.1 and Org-mode 9.0.3.

Pressing esc solves the issue.

I also ended up writing a wrapper fn for it:

(defun jm/open-file (file)
  (find-file (expand-file-name file))
  (evil-normal-state))
@smile13241324

This comment has been minimized.

Contributor

smile13241324 commented Jan 14, 2017

Hmm I have actually ment that it could be interesting whether this still happens with emacs 25. Anyway I have an older 24.5.1 emacs at work maybe I can reproduce it there.

In the meantime would you mind adding a backtrace to your issue because currently I have no idea where this could come from.

Btw: Do you set some org settings in your dotfile without a

(with-eval-after-load 'org
  ;; here goes your Org config :)
  ;; ....
  )

construct? This will trigger spacemacs to load the elpa distribution of org rather than the melpa one which could cause various issues.

org readme

@smile13241324

This comment has been minimized.

Contributor

smile13241324 commented Jan 17, 2017

I have tried to reproduce your issue on my old emacs 24.5.1 on develop. However I was not successful.

Awaiting your backtrace.

@smile13241324

This comment has been minimized.

Contributor

smile13241324 commented Mar 8, 2017

@simpler360 Well now I am confused are you still able to reproduce this issue? If yes could you please supply your dot file and short instructions how to reproduce.

@Vezill

This comment has been minimized.

Vezill commented May 15, 2017

I've also been having this issue for the last week or so since switching to develop and the solutions suggested are not working (edit and save the file, enter and exit insert-mode, pressing esc). The only real changes to my .spacemacs file recently was updating it with all the new changes in develop, as well as removing unused stuff and cleaning it up.

I've included my .spacemacs file just in case it helps, although I'm still learning emacs/spacemacs so hopefully it's not too bad lol.

@smile13241324

This comment has been minimized.

Contributor

smile13241324 commented May 26, 2017

@Vezill Hi there, thanks for your .spacemacs file, I was finally able to reproduce the issue. The problem is that you are using vanilla org-mode instead of the official org layer thanks to not listing org in your layers list.

This also means that the layer specific keybindings are not set as org/init-org is not called, thus the missing major mode binding.

When you add the org layer all works fine.

Btw by scanning your spacemacs file I have noticed an error in your user-config which will also prevent emacs from loading org correctly. You are trying to set (add-hook 'org-mode org-mode-adaptive-wrap) which fails as it must be (add-hook 'org-mode 'org-mode-adaptive-wrap) instead. Also you are trying to add this to org-mode but you should add it to org-mode-hook instead.

@d12frosted I have reproduced the issue but I am not sure that this is really a bug, would you mind having a quick look into it? Seems that it is possible to load org without org layer which will cause missing keybindings.

@Vezill

This comment has been minimized.

Vezill commented May 30, 2017

Thanks for taking a look at my config file @smile13241324 ! Nice catch on the org-mode hook, I'm still learning lol.

I actually noticed myself a few days after posting that I was missing it, and it seemed to fix the problem for a little while. Today while adding a new value to org-todo-keywords, when I went to test it I ran into the same problem again. After running a diff on my old vs current config file I noticed emacs had put more packages into package-selected-packages, including org-plus-contrib, and I couldn't get org-mode to work again until I removed it.

I'm not too sure why this would be, but maybe this info will help.

@cjpoor

This comment has been minimized.

cjpoor commented May 1, 2018

I found that I had to (require 'org) to resolve this issue (at least it seems to be resolved.)
Mint linux, Spacemacs 0.200.13@27.0.50

@dmitry-kabanov

This comment has been minimized.

dmitry-kabanov commented Jun 14, 2018

I had the same issue (SPC m is undefined).

It turned out that I forgot to enable org layer by adding org to the list dotspacemacs-configuration-layers.

Maybe it should be mentioned somewhere at the beginning of the documentation on the org layer.

@smile13241324

This comment has been minimized.

Contributor

smile13241324 commented Jun 14, 2018

Not sure how to make it more obvious than it already is. Currently doc for org says

Since version 0.104, spacemacs uses the org version from the org ELPA repository instead of the one shipped with emacs. Then, any org related code should not be loaded before dotspacemacs/user-config, otherwise both versions will be loaded and will conflict.

Because of autoloading, calling to org functions will trigger the loading up of the org shipped with emacs which will induce conflicts. One way to avoid conflict is to wrap your org config code in a with-eval-after-load block like this:

Also the installer step mentiones that for using the layer it must be added to the dotfile and gives a code example.

Recommendations?

@dmitry-kabanov

This comment has been minimized.

dmitry-kabanov commented Jun 26, 2018

@smile13241324 Well, something like a warning block that states that if you get a "SPC m is undefined" errors, it means that you forgot to add org layer to the .spacemacs.

I guess, it should be enough.

@smile13241324

This comment has been minimized.

Contributor

smile13241324 commented Jun 28, 2018

Agreed, I will add a warning to the org layer readme next time I am working on spacemacs.

@smile13241324

This comment has been minimized.

Contributor

smile13241324 commented Jul 3, 2018

@dmitry-kabanov I have adjusted the Readme.md for 'org'. Would you mind checking whether the current version is more clear?

@cjpoor

This comment has been minimized.

cjpoor commented Jul 3, 2018

@dmitry-kabanov

This comment has been minimized.

dmitry-kabanov commented Jul 3, 2018

@smile13241324 Yes, your pull request (#10985) looks fine to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment