2

How can I re-enable the hash (#) key in carbon-emacs on the mac? I've tried everything I've come across in google and still can't get it working.

My config file currently looks like this:

(require 'redo+)
(require 'mac-key-mode)
(mac-key-mode 1)
(setq default-input-method "MacOSX")
(setq mac-command-modifier 'alt mac-option-modifier 'meta)

The above has enabled all the Command+Key bindings (such as Cmd+S for saving), but Alt+3 isn't working.

I'd normally work around it but I'm programming in Python and # is rather useful for comments! ;)

Phillip B Oldham
  • 18,807
  • 20
  • 94
  • 134
  • There are keyboard layouts which doesn't require Option to generate hash -- US QWERTY and Dvorak, for example, have it as Shift-3. Is this too intrusive? – ephemient Nov 09 '09 at 22:24
  • You could also always just bind (insert "#") to M-3. – jrockway Nov 10 '09 at 02:12
  • Possible duplicate of [Emacs question - hash key](https://stackoverflow.com/questions/3977069/emacs-question-hash-key) – mmmmmm Dec 31 '18 at 11:17

3 Answers3

4

How about adding this to .emacs, setting up a macro and then binding M-3 to it:

(fset 'insertPound
   "#")
(global-set-key (kbd "M-3") 'insertPound)
Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150
0

I know this is a bit late and the answer has been accepted. However, I have just moved from Linux to MacOS and had the same problem.

Posted my response on a similar question: https://stackoverflow.com/a/21722619/1308653

I hope this helps someone.

Community
  • 1
  • 1
robsearles
  • 416
  • 3
  • 3
-2

Have you thought about moving to Aquamacs?

Kendall Helmstetter Gelner
  • 74,769
  • 26
  • 128
  • 150