Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruby mode RET bound to newline (without indent), and cannot reassign #40

Open
biot023 opened this issue May 28, 2013 · 4 comments
Open

Comments

@biot023
Copy link

biot023 commented May 28, 2013

Hi. I'm using the latest emacs24 starter kit, but it seems to be broken with regard to the RET key in Ruby mode.
When I type C-h k to see what is bound to the return key, it tells me that it is newline (not the newline and indent) function that is.
I cannot see where this reassignment is happening to correct it, and (as I am a Ruby dev), this makes everything pretty unusable.
I've tried reassigning the key for ruby and globally at the end of my init.el, but to no avail.
I've also tested the problem with a fresh install of the starter kit to be sure that it's not something I have done.
I'm running EMACS 24 on Ubuntu 13.04.
Cheers,
Doug.

@biot023
Copy link
Author

biot023 commented May 28, 2013

Update: It looks like a confilct with yasnippet. Adding the following to the end of my init.el file seems to have fixed the issue for now, unless it has introduced any other wrinkles I've yet to come across:

;; Indent on newline
(define-key global-map (kbd "RET") 'newline-and-indent)
(eval-after-load 'ruby-mode
'(progn
(define-key ruby-mode-map (kbd "RET") 'reindent-then-newline-and-indent)))
(eval-after-load 'yas-mode
'(progn
(define-key yas-mode-map (kbd "RET") 'reindent-then-newline-and-indent)))

@eschulte
Copy link
Owner

Thanks for sharing your solution. If you could turn this into a patch against starter-kit-ruby.org which does not change the global key map then I'd be happy to apply the patch. If yasnippet is changing key bindings in ruby mode, then maybe this should be reported upstream to the yasnippet maintainers.

@morganastra
Copy link
Contributor

Just a shot in the dark, but yasnippet is clobbering the ruby-mode keymap, could you fix it by loading them in the other order?

@biot023
Copy link
Author

biot023 commented May 30, 2013

I'll have a look, but it will have to wait until next week, I'm afraid --
we have a new dev starting, and I'm working pretty much around the clock to
get everything ready for them.
Of all the times to buy a new computer, too! :)
Cheers,
Doug.

On 29 May 2013 18:57, jumpcannon notifications@github.com wrote:

Just a shot in the dark, but yasnippet is clobbering the ruby-mode keymap,
could you fix it by loading them in the other order?


Reply to this email directly or view it on GitHubhttps://github.com//issues/40#issuecomment-18634494
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants