From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: Re: Small improvements to ruby-mode Date: Sun, 11 Aug 2013 14:54:08 +0300 Message-ID: References: <2A6700DEDCA640EF92B326002717596D@gmail.com> <51DB6516.1090708@yandex.ru> <51DC43CE.3090206@yandex.ru> <51DDA366.9020700@yandex.ru> <51E06787.8020401@yandex.ru> <51E1A62A.1030204@yandex.ru> <51E55CFB.7060303@yandex.ru> <52040BD8.20902@yandex.ru> <52042FC9.6000505@yandex.ru> <520627D8.8090206@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7bea3e6a57064804e3aaaade X-Trace: ger.gmane.org 1376222059 27158 80.91.229.3 (11 Aug 2013 11:54:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 Aug 2013 11:54:19 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 11 13:54:22 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V8UE1-0005un-Kd for ged-emacs-devel@m.gmane.org; Sun, 11 Aug 2013 13:54:21 +0200 Original-Received: from localhost ([::1]:38168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8UE1-0004Fw-0F for ged-emacs-devel@m.gmane.org; Sun, 11 Aug 2013 07:54:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8UDu-0004Ey-BW for emacs-devel@gnu.org; Sun, 11 Aug 2013 07:54:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8UDp-00080p-Uz for emacs-devel@gnu.org; Sun, 11 Aug 2013 07:54:14 -0400 Original-Received: from mail-qe0-x22d.google.com ([2607:f8b0:400d:c02::22d]:43256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8UDp-00080j-Py for emacs-devel@gnu.org; Sun, 11 Aug 2013 07:54:09 -0400 Original-Received: by mail-qe0-f45.google.com with SMTP id x7so3130083qeu.18 for ; Sun, 11 Aug 2013 04:54:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=ck4WCGnwATd4fQl2F7CYVPDrcvmMZ02/V1S1stiaTBk=; b=TaUCP5Y49hk49MxjeAqMW1pHc9r+83+cHagIlXsbqQuGFtza2eIYdXgrcQt5Ql+rj2 CKUq1EoiXvGXcAHV6cjQPrqv4DlJxMbRYGhPzL1+lDaRGFXs+0wFjrOLRF3yd1QCcMVn QcP5v/vPK6kR37uAz5IKslEr3XChKDGdTjGLsY2is5p2KKH9xTHOBkLCcBiUoA/l3/W+ rl1QBHOF3z7wDwvARKEaKU+bG6t2WV+S6WxjXhYUqsYrkcEl87cC4lK6rXk97RghmfPc 1povExT/5DJSr5aLWmg+LWmXxRdtU6iafaRee+br5A7fhCq1sYqoMH+eH0aDDi9sF8LT aJOQ== X-Received: by 10.49.17.101 with SMTP id n5mr9168196qed.88.1376222048606; Sun, 11 Aug 2013 04:54:08 -0700 (PDT) Original-Received: by 10.49.12.7 with HTTP; Sun, 11 Aug 2013 04:54:08 -0700 (PDT) In-Reply-To: <520627D8.8090206@yandex.ru> X-Google-Sender-Auth: pHXLHMZhKKRkSXttaunWXE6f7UE X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c02::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:162564 Archived-At: --047d7bea3e6a57064804e3aaaade Content-Type: text/plain; charset=UTF-8 On 10 August 2013 14:45, Dmitry Gutov wrote: > 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-. 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. > The interpolate functionality seems redundant to me, so I'd suggest dropping 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? > Having ERT tests is never a bad idea. That said I don't think there will be a risk of upstream divergence, since I'm pretty sure after ruby-tools is merged into ruby-mode the existing project will be decommissioned. > > 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. > But if our case there won't be to similar repos, as noted above - most likely the current project will cease to exist. --047d7bea3e6a57064804e3aaaade Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 10 August 2013 14:45, Dmitry Gutov &l= t;dgutov@yandex.ru> wrote:
On 09.08.2013 17:52, Stefan Monnier wrote:
That's lucky for those poor minor modes: it's always really difficu= lt 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 it= s prefix, it's the major mode that is screwed, because minor mode bindi= ngs trump major mode ones.


Usually major modes prefer to use bindings which start with C-c
C-<something>. =C2=A0There are usually many such keys available and t= hey'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-quo= te-string)
(define-key map (kbd "C-c C-\"") 'ruby-tools-to-double-q= uote-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 amoun= t of keystrokes the user types, but typing `# { } C-b' is not that long= er, and with `autopair-mode' enabled (or `electric-pair-mode', I su= ppose'), we only have to type `# {' anyway.
Maybe we should just drop it.

The inter= polate functionality seems redundant to me, so I'd suggest dropping it.=
=C2=A0

Here's another issue: ruby-tools comes with a suite of tests written us= ing ecukes, which is not included with Emacs, and would be incompatible wit= h 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?

Having= ERT tests is never a bad idea. That said I don't think there will be a= risk of upstream divergence, since I'm pretty sure after ruby-tools is= merged into ruby-mode the existing project will be decommissioned.
=C2=A0

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

But if our case the= re won't be to similar repos, as noted above - most likely the current = project will cease to exist.
--047d7bea3e6a57064804e3aaaade--