Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paredit forward slurp "C-)" does not work for emacs on Windows 7

Tags:

emacs

paredit

After migrating to win7 paredit's forward slurp "C-)" no longer works and "C-right arrow" still works, rebinding the sexp to a different combination (such as C-0) works as well.
Does anyone have the same issue out there?

like image 461
siyu Avatar asked May 17 '12 22:05

siyu


3 Answers

Windows 7 uses Ctrl + Shift to switch languages, so Emacs is never getting the key strokes. You can change the binding with the following:

  • Control panel
  • Region and Language
  • Keyboards and Languages
  • Change Keyboards
  • Advanced Key Settings
  • Between input languages
  • Change Key Sequence
  • Switch Keyboard Layout
  • Not Assigned.

http://www.eightforums.com/general-support/22552-cant-use-ctrl-shift-0-windows-has.html

like image 106
Mason Avatar answered Nov 02 '22 05:11

Mason


It happens on Windows 7, if you have more than one input language. Ctrl-Shift-0, Ctrl-Shift-1, ... are for quick switching of the input language. Seems to be unfixable, as Windows intercepts certain key combinations (e.g. Win-E, Win-D, etc.) and doesn't pass it down to the application. Could be worse, Intel GMA driver doesn't let you use Ctrl-Alt-Up/Down on Win XP.

Just use another shortcut in Emacs (or you can try to remap keys using tools like, Sharpkeys).

like image 44
EvgeniySharapov Avatar answered Nov 02 '22 04:11

EvgeniySharapov


Paredit version I have bind the forward slurp command to <C-right> and C-). I can verify that the latter key is consumed by the operating system, MS Windows 8 in my case, so Emacs can't receive that key. So you might want to use <C-right> instead, but then since that key (and also <C-left> which is bound to another paredit command) is normally for movement (outside of paredit), maybe you might want to use your own custom different key. I use C-*. The following is the configuration I use, and you can take the parts you want.

(require 'paredit)

(define-key paredit-mode-map (kbd "C-*") 'paredit-forward-slurp-sexp)

;; Make the key no longer bound to paredit-forward-barf-sexp
(define-key paredit-mode-map (kbd "<C-left>") nil)

;; Make the key no longer bound to paredit-forward-slurp-sexp
(define-key paredit-mode-map (kbd "<C-right>") nil)

(define-key paredit-mode-map (kbd "<C-backspace>") 'paredit-backward-kill-word)
like image 1
Jisang Yoo Avatar answered Nov 02 '22 05:11

Jisang Yoo