23

I would like to know how to start troubleshooting the following: C-SPC is not doing anything.

It's not appearing in the mini-buffer when I type it but when I look at M-x set-mark-commandit's showing as bound to C-SPC.

Environment
I've installed GNU Emacs (24.5.1) via Homebrew and my .emacs.dis based off of Clojure for the Brave and True with some additional packages.

Steps taken so far
I firstly tried deleting and reinstalling with no affect so what steps can I take to pin-point what's going on?

Additional Info
A list of all installed packages is in screenshot below:

enter image description here

wdmssk
  • 3
  • 1
  • 2
m__
  • 923
  • 1
  • 7
  • 12
  • 5
    What happens when you use `C-h k C-SPC`? Do you see a `*Help*` buffer with the command it is bound to? If nothing at all happens then Emacs is not seeing the `C-SPC` that you type - it is not receiving it from your keyboard, or it is decoding it improperly. – Drew Mar 29 '16 at 13:59
  • 3
    Try starting Emacs using `emacs -Q` (no init file). Can you reproduce the problem that way? IOW, remove all of your customizations from the equation (and clearly you have a lot) - all of those packages etc.. – Drew Mar 29 '16 at 14:00
  • 1
    Do you run Emacs as a GUI application or in a terminal window? – Lindydancer Mar 29 '16 at 14:30
  • 2
    I am looking for this solution too. I don't see this problem; but a colleague is seeing it. The problem seems to be more OS level (not specific to emacs). But the strange thing is that we are using the exact same OS. Here is one way to test if emacs can see the `C-SPC` binding. In a terminal, type `cat` and then hit `C-SPC`. This binding works for me in emacs and I also see that doing so after `cat` displays `^@`. But when my colleague (for whom `C-SPC` does not work) does the same, he sees nothing!, no `^@`. It's as if his environment doesn't receive those key codes at all. – Kaushal Modi Mar 29 '16 at 18:13
  • Also, this issue in seen both `emacs -Q` and `emacs -Q -nw`. Tried accessing Linux machine (RHEL 6.6) via VNC (Gnome) and Putty.. same issue. – Kaushal Modi Mar 29 '16 at 18:35
  • I'm exactly such a 'colleague' that Kaushal Modi described. `C-SPC` works for me on a MacBook with macOS, but if I run Linux on DeX on a Note 9, my Logitech Keys-to-Go bluetooth keyboard just doesn't recognize `C-SPC`; of course, both `C` and `SPC` work when used separately in other contexts. I still couldn't figure out why the Ubuntu 16.04 container that Linux on DeX currently is does that (even when doing `emacs -Q`). – Marius Hofert Jun 09 '19 at 14:44
  • When I connect the keyboard to the MacBook, `C-SPC` works, so it is a problem of Samsung/Linux on DeX for sure. – Marius Hofert Jun 09 '19 at 15:02

2 Answers2

43

System Preferences > Keyboard > Shortcuts > Input Sources > Select the previous input source and uncheck

saltycraig's tip on C-h k C-SPC did nothing when I typed it. So, thanks to Kaushal Modi for pointing towards the OS level. Saved many hours of messing around with all my packages.

For completeness I run it as a GUI app (so will need to go and investigate how to start it with emacs -Q).

Thanks everyone!

enter image description here

m__
  • 923
  • 1
  • 7
  • 12
  • 2
    To start a GUI Emacs without an init file, you can either temporary rename your init file, or start Emacs from a terminal window using e.g. /Applications/Emacs.app/Contents/MacOS/Emacs -Q. – Lindydancer Mar 30 '16 at 13:35
  • I was running terminal emacs on a mac and encountered the same problem. I was going to try your solution, but found the two boxes were _already unchecked_. However, when I pressed 'Restore Defaults' (effectively checking the boxes), and then _unchecked_ the boxes again, everything worked fine again, and my problem was solved. – Georg Oct 14 '20 at 12:55
  • I was trying to configure an external keyboard today, and tinkered with the input sources. This shortcut was automatically activated and C-SPC stopped working. While I suspected it was some BS related to the input sources, I could not have found it without you. Thanks – deddu Jan 28 '22 at 15:41
7

One of the installed packages you have there may be overriding the C-SPC keybinding for something else. Try starting emacs without loading your init file:

$ emacs -Q

Now try doing the key combination:

C-h k C-SPC

And you should see a buffer telling you what it is mapped to. If you don't then the problem is external to Emacs. In that case, one of the other programs you are running is either capturing the C-SPC keystroke and/or preventing it from getting to Emacs. This would be a case of closing all other programs before starting Emacs and also checking for custom keyboard combinations in system settings.

cmaceachern
  • 171
  • 3