Just getting used to pareit in emacs on OS X - why does C-) not work?

I recently installed the general Lisp programming environment on Mac OS X Leopard. One emacs module that I found indispensable is paredit. Paredit is doing my best to help me compress my Lisp code more easily, but I ran into a few traps.

C-), associated with paredit-forward-slurp-sexp , does not force the sexps offset, but instead repeats the number 0 . I use a Mac, alternating between iTerm and Terminal. The same problem is present in both applications.

I tried the same key combination in the GNU Emacs GUI version and it worked. Unfortunately, the graphical version of Emacs does not satisfy my needs; I would like to continue to use my iTerm based platform.

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

+7
source share
5 answers

IIRC, a combination of Control and Shift modifiers cannot be sent to Emacs in the terminal. C-) shift key is required, so it goes beyond. I'm not sure that any number of terminal settings will change this.

I believe that paredit-forward-slurp-sexp also binds to C-<right> by default, which should work fine in the terminal, so maybe you can train your fingers to use this key.

+4
source

For what it's worth, on my Mac, C- <right> and C- <left> are tied 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 hide pardit and barf nicely on emacs.

+6
source

Based on Cosmin Blog I got this to work on iTerm2.

  • Go to Settings> Profiles> Keys . (You can copy the default profile and change the copy.)
  • Press + under the keys . .
  • Type Ctrl+) (ctrl + shift + leftparen).
  • For Action, select Send evacuation symbol and
  • put [1;5C in the text box.
+3
source

I have a suspicion that your iTerm / Terminal programs cannot actually send C-) , because there is no such character in ASCII, and I am sure that there is no sequence on the VT100.

You can check it out for yourself. Run emacs in a terminal emulator. Enter C-) . Then enter Ch l ("view-lossage"). This will show you the last few hundred keys that Emacs saw in your type. Try the same after entering uncontrolled ) to see if they are different. If not, you're out of luck if you can't configure iTerm / Terminal to send them to Emacs in various ways.

However, you can always bind another key to paredit-forward-slurp-sexp .

+2
source

I ran into the same problems as paredit alternate C- <right> binding, and found that tmux was causing my problem. Basically, tmux turned on C- and just followed <right> .

I found a solution at https://unix.stackexchange.com/a/34484 and it included adding

 set-window-option -g xterm-keys on 

to my ~ / .tmux.conf.

+2
source

All Articles