Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set-mark-command not working emacs with C-SPC

Tags:

emacs

I am not able to set the mark at the current point by C-SPC (both when emacs loads the init file and when it doesn't). However, when I do M-x set-mark-command, the mark is well set and I am able to select the region by moving the cursor. When I do M-x apropos set-mark-command, it shows two bindings C-@ and C-SPC, but only the first one works. Any suggestions will be appreciated. I am running emacs 24.3 on a GUI on Kubuntu 14.04.

like image 888
Sagar Jha Avatar asked May 04 '14 11:05

Sagar Jha


People also ask

How do you set a mark in Emacs?

To set the mark, type C- SPC ( set-mark-command ). This makes the mark active; as you move point, you will see the region highlighting grow and shrink. The mouse commands for specifying the mark also make it active.

How do I select a region in Emacs?

Click the mouse's left button at the start of the area to be selected, and drag the mouse to the end of the area. The region you selected should be highlighted.


2 Answers

Ubuntu 14.04 has an open bug affecting some desktop environments (at least KDE, LXDE and i3, but not Unity).

The default IBus key binding for "next input method" is Ctrl+Space, which prevents this key combination from reaching Emacs (or any other userspace program). To resolve the issue, run ibus-setup and change the key binding for "next input method" to something else (or delete it entirely by clicking the "..." button and then the "Delete" button).

Note that running ibus-setup from Unity, where C-SPC works already, shows a preferences window that does not include the key binding option that needs to be changed.

The "next input method" command cycles through your configured inputs, e.g. perhaps from English to French.

like image 72
Chris Avatar answered Sep 22 '22 04:09

Chris


So I tracked down a similar issue to this on macOS. It seems that at some point C-SPC became bound to "Select the previous input source":

keyboard preferences pane

like image 44
Will Avatar answered Sep 19 '22 04:09

Will