Keybindings for enh-ruby-mode, too #19

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@danielsz

danielsz commented Mar 6, 2013

This patch makes the keybindings work in enhanced-ruby-mode.
The patch is rough because of ugly duplication, but the idea is that inf-ruby should work with other modes aside of ruby-mode. So maybe this is a start of a discussion.

@dgutov

This comment has been minimized.

Show comment Hide comment
@dgutov

dgutov Mar 6, 2013

Collaborator

Here's an alternative suggestion: create a minor mode, and put all bindings on its keymap.

Collaborator

dgutov commented Mar 6, 2013

Here's an alternative suggestion: create a minor mode, and put all bindings on its keymap.

@danielsz

This comment has been minimized.

Show comment Hide comment
@danielsz

danielsz Mar 6, 2013

I like the idea. Can you maybe elaborate on what exactly you envision? How will inf-ruby interact with the minor mode, who is calling who, things like that...

danielsz commented Mar 6, 2013

I like the idea. Can you maybe elaborate on what exactly you envision? How will inf-ruby interact with the minor mode, who is calling who, things like that...

@dgutov

This comment has been minimized.

Show comment Hide comment
@dgutov

dgutov Mar 6, 2013

Collaborator

The minor mode will be just for the sake of the keymap.

  • The minor mode will be on in ruby-mode buffers, but not in inf-ruby-mode buffers.
  • inf-ruby-setup-keybindings body will go to the inf-ruby-minor-mode-map definition.
  • inf-ruby-setup-keybindings body will be (add-hook 'ruby-mode 'inf-ruby-minor-mode), for backward compatibility (otherwise we'd just replace the eval-after-load form at the bottom with add-hook).
  • The body of (define-minor-mode inf-ruby-minor-mode will be empty (I think?).
  • As far as enh-ruby-mode goes, you'll either add a second add-hook call to inf-ruby-setup-keybindings, or add it under ;;;###autoload at the bottom of the file.
  • The minor mode could use a more descriptive name, but even this one should do.
Collaborator

dgutov commented Mar 6, 2013

The minor mode will be just for the sake of the keymap.

  • The minor mode will be on in ruby-mode buffers, but not in inf-ruby-mode buffers.
  • inf-ruby-setup-keybindings body will go to the inf-ruby-minor-mode-map definition.
  • inf-ruby-setup-keybindings body will be (add-hook 'ruby-mode 'inf-ruby-minor-mode), for backward compatibility (otherwise we'd just replace the eval-after-load form at the bottom with add-hook).
  • The body of (define-minor-mode inf-ruby-minor-mode will be empty (I think?).
  • As far as enh-ruby-mode goes, you'll either add a second add-hook call to inf-ruby-setup-keybindings, or add it under ;;;###autoload at the bottom of the file.
  • The minor mode could use a more descriptive name, but even this one should do.

@dgutov dgutov closed this in 33e17e0 Jun 1, 2013

@dgutov

This comment has been minimized.

Show comment Hide comment
@dgutov

dgutov Jun 1, 2013

Collaborator

@danielsz I've committed the changes described above. Please test that they work for you.

Collaborator

dgutov commented Jun 1, 2013

@danielsz I've committed the changes described above. Please test that they work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment