Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Associate ` to <S-dead-grave> in Emacs

Tags:

emacs

elisp

What do I have to write in my .emacs file in order to associate the <S-dead-grave> command with inserting the character ` (backtick).

I run GNU Emacs 23.1.1 on Unix.

Background: I run Unix via a shell that runs in Java (Oracle SGD) on a Windows terminal server. I do not have admin access on either system. My keyboard is set to Norwegian. There is apparently some bug in Java causing this to act weird with "dead" characters (like ` is on the Norwegian keyboard) and I have not succeeded in getting my administrator to fix this.

When I click ` followed by a space (as is the way to insert that character with my keyboard layout) in Emacs, I get the error message <S-dead-grave> is undefined. Hence, I believe that if I could define this, I would be able to work around this error.

Within this setup, I am also happy with alternative workarounds.

like image 356
Jørgen Avatar asked Feb 19 '23 23:02

Jørgen


1 Answers

It's not completely clear to me whether you run Emacs in GUI mode or in text mode (in a terminal emulator), but based on your description of Emacs's behavior I guess it runs in GUI mode (maybe via some X server on your Windows machine?).

It's strange that you'd get S-dead-grave events, so it might be a bug in your GUI environment (your X server's config?).

But in any case

(global-set-key [S-dead-grave] "`")

might let you work around the problem.

like image 89
Stefan Avatar answered Feb 27 '23 01:02

Stefan