Tzu ng
Tzu ng

Reputation: 9244

Bind C-, and C-

Is there anyway that we can bind C-, and C-. in emacs ? I have tried this (define-key global-map (kbd "C-,") 'action) but it doesn't seem to work.

I use Emacs on Ubuntu with US keyboard layout.

Thanks

Upvotes: 1

Views: 95

Answers (2)

Stefan
Stefan

Reputation: 28531

I'm pretty your define-key does work.

But most likely when you hit C-, Emacs doesn't actually receive this.

What does C-h k C-, tell you? What about C-, C-h l ?

My crystal ball tells me you're running in a text-terminal of some sort. In those beasts many key combos don't actually get through correctly to the running application.

Upvotes: 2

You could try some key binding commands, e.g.

(global-set-key [(control ?,)] 'some-action)

in your ~/.emacs file (to make your key binding permanent, and available after restart). BTW, you could evaluate that first to test it. Then restart your emacs and use C-h k C-, to check if it is bound.

Upvotes: 1

Related Questions