[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Small improvements to ruby-mode

From: Dmitry Gutov
Subject: Re: Small improvements to ruby-mode
Date: Sat, 10 Aug 2013 14:45:28 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130803 Thunderbird/17.0.8

On 09.08.2013 17:52, Stefan Monnier wrote:
That's lucky for those poor minor modes: it's always really difficult to
find good bindings for minor modes because there are very few bindings
reserved for them, and they have the added problem of having to cohabit
with other minor modes.

I don't think it's that big of a problem. Minor minor modes either do, or should allow the user to customize the prefix. So they can change it in case of a conflict. And anyway, if a minor mode picks `C-c #' as its prefix, it's the major mode that is screwed, because minor mode bindings trump major mode ones.

Usually major modes prefer to use bindings which start with C-c
C-<something>.  There are usually many such keys available and they're
pretty easy to type since you can just keep the control key pressed.

Ok, here's a possible set of bindings:

(define-key map (kbd "C-c C-'") 'ruby-tools-to-single-quote-string)
(define-key map (kbd "C-c C-\"") 'ruby-tools-to-double-quote-string)
(define-key map (kbd "C-c C-:") 'ruby-tools-to-symbol)
(define-key map (kbd "C-c C-;") 'ruby-tools-clear-string)
(define-key map (kbd "C-c C-#") 'ruby-tools-interpolate)

The last one is the most problematic: it's supposed to reduce the amount of keystrokes the user types, but typing `# { } C-b' is not that longer, and with `autopair-mode' enabled (or `electric-pair-mode', I suppose'), we only have to type `# {' anyway.
Maybe we should just drop it.

Here's another issue: ruby-tools comes with a suite of tests written using ecukes, which is not included with Emacs, and would be incompatible with the current test directory layout anyway.

Should they be rewritten using ERT? Or do we drop them and risk divergence from upstream and code breakage?

N.B.: Out of two similar repositories, one with tests and one without, it's natural for me to consider the former one as upstream.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]