Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Just getting used to paredit in emacs on OS X - how come C-) doesn't work?

I've recently set up a Common Lisp programming environment in Mac OS X Leopard. One emacs module which I've found to be indispensable is paredit. Paredit is doing its part to help me wrangle my Lisp code more easily, but I've ran into a bit of a snare.

C-), bound to paredit-forward-slurp-sexp, is not forward slurping sexps but instead echoing the number 0. I'm using a Mac, alternating between iTerm and Terminal. The same problem is present in both apps.

I tried the same key combination in GNU Emacs' GUI version, and lo, it worked. Unfortunately the graphical version of Emacs does not satisfy my needs; I would like to keep using my iTerm based rig.

So I ask you, stackoverflow: what do I have to do to get the C-) combo to register with iTerm?

like image 647
Joe Taylor Avatar asked Jun 07 '11 04:06

Joe Taylor


2 Answers

For what is worth, on my Mac C-<right> and C-<left> are bound to Mission Control and move to the right and left spaces.

Having said that, C-Shift-<right> and C-Shift-<left> seem to do the trick and I can slurp and barf nicely on emacs with paredit.

like image 140
Jose B Avatar answered Oct 05 '22 04:10

Jose B


IIRC, the modifier combination of Control and Shift cannot be sent to Emacs in a terminal. C-) requires the shift key, so it's out of bounds. I'm not convinced that any amount of terminal tweaking will change this.

I believe paredit-forward-slurp-sexp also gets bound to C-<right> by default, which should work fine in a terminal, so perhaps you can train your fingers to use that key instead.

like image 32
sanityinc Avatar answered Oct 05 '22 02:10

sanityinc