Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using Carbon-Emacs on MacOS X 10.6 with the US-International keyboard layout. Usually, I can use Alt+s to print the letter "ß". However, Emacs interprets this as Meta+s and complains that there is no command bound to that shortcut. So my questions are:

  1. How can I create such a shortcut?
  2. Is there another way to print the character "ß"?
share|improve this question

2 Answers 2

up vote 3 down vote accepted

Answer to 1.

Try adding this to your emacs configuration file (should be ~/.emacs.d/init.el or alike):

(define-key global-map [(meta s)] [?\u00DF])
share|improve this answer
    
When entering the shortcut I get After 0 kbd macro iterations: Keyboard macro terminated by a command ringing the bell. –  Björn Pollex Aug 1 '11 at 18:58
    
@Björn: I don't completely understand why, but it seems that a \ is needed at the end. –  Stéphane Gimenez Aug 1 '11 at 19:47
    
Hm, still getting the same error. –  Björn Pollex Aug 1 '11 at 20:15
    
@Björn: See my last try, if this one doesn't work, I'll give up :-) –  Stéphane Gimenez Aug 1 '11 at 20:53
    
This one works, thanks! –  Björn Pollex Aug 2 '11 at 9:21

Put the following in your .emacs ... I don't use a Mac, so I couldn't test that side of it. However this works for me.
The original define-key global-map presented by Björn Pollex did not work for me, but his latest version using (U+00DF) does work (for me), I can't tell from your comments (till now), if it works for you.. If it doesn't, try this one..

(defun insert-sharp-s ()
  "Insert Unicode Character 'LATIN SMALL LETTER SHARP S' (U+00DF)"
       (interactive)
       (insert "ß")
       )
(global-set-key "\M-s" 'insert-sharp-s)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.