Can't insert curly brace for string interpolati...

Ruby uses the syntax "... #{_expression_}..." for string interpolation. But when I press left curly brace, Emacs says "Symbol's value as variable is void: last-command-char".

I C-h k {, and saw that { and } are bound to ruby-electric-brace. This function appears to be malfunctioning.

As a workaround, I M-x fundamental-mode, typed a literal { and }, then M-x ruby-mode. Doing this repeatedly became a hassle, so I added a temporary hook to my .emacs:

(add-hook 'ruby-mode-hook
          (lambda ()
            (define-key ruby-mode-map "{" nil)
            (define-key ruby-mode-map "}" nil)))

你可能感兴趣的:(Can't insert curly brace for string interpolati...)