1

I was not sure if this is a Spacemacs issue or a local configuration issue, hence I figured I would post to Emacs Stackexchange.

When I use the Spacemacs key SPC-m : to try and add a tag to an orgmode bullet point (or subtree heading), I get this error: Wrong type argument: commandp, org-set-tags. However, when I use the normal Orgmode key combination C-c C-q the tag will insert just fine.

I updated Spacemacs and the set of packages as well, but still getting the error. Not sure what would be causing this.

  • Do you see the problem if you start Emacs with emacs -Q (no init file)? If not, bisect your init file to find the culprit. You can also set debug-on-error to non-nil to see a backtrace when the error is raised. That will show you what function is complaining about expecting a command but getting org-set-tags instead, what called that function, etc. Add such info to your question. – Drew Apr 14 at 1:45
3

I believe this error happens because the command org-set-tags has been renamed to org-set-tags-command in org-mode (which you can see in this commit), but the keybinding hasn’t yet been updated in the master branch for Spacemacs.

On the develop branch, the binding has been updated to the new command, and moved to SPC m i t, which you can see here (currently it’s at line 325).

There is still a function called org-set-tags, but I think this error happens because it’s (not/no longer) meant to be called interactively (i.e. from a keybinding).

So, to fix this without updating to the develop branch, you can add the following code to your .spacemacs file (which you can edit using the command spacemacs/find-dotfile, normally bound to SPC f e d):

(with-eval-after-load 'org
  ;; Replace org-set-tags with org-set-tags-command in keybinding
  (spacemacs/set-leader-keys-for-major-mode 'org-mode ":" 'org-set-tags-command)
)

(At the recommendation of the org layer docs, I’ve used with-eval-after-load.)

  • 1
    Oh thanks so much. Yes, I tried this and it seems to work now. I really appreciate it. I was having such a problem when the tags stopped working. Glad they are working again. – krishnab May 15 at 17:28
  • No problem, glad to help! – Noel May 16 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.