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: Small improvements to ruby-mode Date: Fri, 21 Jun 2013 19:00:46 +0300 Message-ID: <2A6700DEDCA640EF92B326002717596D@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="51c478ae_1d91467c_b3" X-Trace: ger.gmane.org 1371830472 14258 80.91.229.3 (21 Jun 2013 16:01:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Jun 2013 16:01:12 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 21 18:01:14 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 1Uq3lx-0007Jr-Pd for ged-emacs-devel@m.gmane.org; Fri, 21 Jun 2013 18:01:14 +0200 Original-Received: from localhost ([::1]:34535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uq3lx-0007Ck-Ao for ged-emacs-devel@m.gmane.org; Fri, 21 Jun 2013 12:01:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uq3lT-0006kr-HQ for emacs-devel@gnu.org; Fri, 21 Jun 2013 12:00:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uq3lO-0000ao-7i for emacs-devel@gnu.org; Fri, 21 Jun 2013 12:00:43 -0400 Original-Received: from mail-ea0-x230.google.com ([2a00:1450:4013:c01::230]:34618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uq3lN-0000aS-Ql for emacs-devel@gnu.org; Fri, 21 Jun 2013 12:00:38 -0400 Original-Received: by mail-ea0-f176.google.com with SMTP id z15so4744967ead.35 for ; Fri, 21 Jun 2013 09:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:message-id:subject:x-mailer:mime-version :content-type; bh=EUE2vgOzlGxkZH7JgOaNNGq2H+RfgntHGc8mserayJ0=; b=qMoSPiuRAvpaH8xh6ytCN0pbAT+nFsEZo1BUzIdCfIuK6VhPBJLVJj/YjIVa4exrNY CmtiOIsbpb20SGxGdd/hwlS98aXm7HHZa4aHxJb68Ofi7CLEq7AYhY9MAKJPOyOpa6Je 1852ybMPYhl9MZ0/D4g1hLgJzcd9Xzr8Ev0dgraFQjo7JYehJ+hbNuELBh89Q2eLljzU Vg4LAh1abYogsi2eStjCENSlUws/A1F9CPHSwXegNBxBcZemJdDym2p6pa0t0WezDNOh DLLsukJQ39xjSa5AFaOIyXuRgAeItP+wEkGjQMc9dcyb+JNcZuUz/EOJoO3OxGyAOKsy ayzA== X-Received: by 10.15.26.68 with SMTP id m44mr13340379eeu.110.1371830436643; Fri, 21 Jun 2013 09:00:36 -0700 (PDT) Original-Received: from [192.168.1.28] ([95.87.231.111]) by mx.google.com with ESMTPSA id y1sm3923895eew.3.2013.06.21.09.00.34 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Jun 2013 09:00:35 -0700 (PDT) X-Mailer: sparrow 1.6.4 (build 1178) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::230 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:160843 Archived-At: --51c478ae_1d91467c_b3 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi guys, Here's a list of small improvements to ruby-mode that we might want to include in a future version of Emacs: * Font-lock changes Some of the Ruby "keywords" that are currently highlighted as keywords are not actually Ruby keywords, but plain methods - alias_method, module_function, throw, raise, private, protected, public. I feel that they should not be highlighted like this to keep the highlighting syntactically correct. Technically speaking true, false and self are also keywords, but given their semantics I guess the current highlighting is ok. On a related note I think that it would make sense to use font-lock-builtin-face for methods like alias_method, module_function, throw, raise, private, protected, public and other keyword like methods for Kernel and Module. I feel that such a move would increase the readability of the Ruby source code. * Treat more filenames/file extensions as Ruby code Most Rubyists these days have to add the following in their Emacs config: (add-to-list 'auto-mode-alist '("\\.rake\\'" . ruby-mode)) (add-to-list 'auto-mode-alist '("\\.ru\\'" . ruby-mode)) (add-to-list 'auto-mode-alist '("Gemfile\\'" . ruby-mode)) (add-to-list 'auto-mode-alist '("Guardfile\\'" . ruby-mode)) (add-to-list 'auto-mode-alist '("Capfile\\'" . ruby-mode)) (add-to-list 'auto-mode-alist '("\\.thor\\'" . ruby-mode)) (add-to-list 'auto-mode-alist '("Thorfile\\'" . ruby-mode)) (add-to-list 'auto-mode-alist '("Vagrantfile\\'" . ruby-mode)) (add-to-list 'auto-mode-alist '("\\.jbuilder\\'" . ruby-mode)) I think it's time the defaults in ruby-mode be updated to include them. * Implement some ruby-tools like commands in ruby-mode ruby-tools is a small package, that adds some extra code manipulation commands https://github.com/rejeep/ruby-tools The commands there need a bit of polish, but are generally a step in the right direction IMO. A least of a few of the commands there deserve to be part of ruby-mode itself, so more users would get to use them. I have other crazier ideas, but I'll stop for now :-) I'd like to hear what you think! I can make the necessary changes and provide patches if you think that my suggestions make sense. -- Cheers, Bozhidar --51c478ae_1d91467c_b3 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Hi guys,

Here's a list of small improvemen= ts to ruby-mode that we might want to include in a future version of Emac= s:

* =46ont-lock changes
<= font face=3D=22Trebuchet MS=22>
Some of the Ruby =22keywords=22 that are currently highlighte= d as keywords are not actually Ruby keywords, but plain methods - alias=5F= method, module=5Ffunction, throw, raise, private, protected, public. I fe= el that they should not be highlighted like this to keep the highlighting= syntactically correct. Technically speaking true, false and self are als= o keywords, but given their semantics I guess the current highlighting is= ok. 

On a related note I think that i= t would make sense to use font-lock-builtin-face for methods like  a= lias=5Fmethod, module=5Ffunction, throw, raise, private, protected, public and other= keyword like methods for Kernel and Module. I feel that such a move woul= d increase the readability of the Ruby source code.

=
* Treat more= filenames/file extensions as Ruby code

Most Rubyists these days have to add the = following in their Emacs config:

(add-to-list 'auto-= mode-alist '(=22=5C=5C.rake=5C=5C'=22 . ruby-mode))
(add-to-lis= t 'auto-mode-alist '(=22=5C=5C.ru=5C=5C'=22 . ruby-mode))
(add-= to-list 'auto-mode-alist '(=22Gemfile=5C=5C'=22 . ruby-mode))
(= add-to-list 'auto-mode-alist '(=22Guardfile=5C=5C'=22 . ruby-mode))
=
(add-to-list 'auto-mode-alist '(=22Capfile=5C=5C'=22 . ruby-mode))
(add-to-list 'auto-mode-alist '(=22=5C=5C.thor=5C=5C'=22 . ruby-= mode))
(add-to-list 'auto-mode-alist '(=22Thorfile=5C=5C'=22 . = ruby-mode))
(add-to-list 'auto-mode-alist '(=22Vagrantfile=5C=5C= '=22 . ruby-mode))
(add-to-list 'auto-mode-alist '(=22=5C=5C.jb= uilder=5C=5C'=22 . ruby-mode))

I think it's time the defaults in ruby-mode be updated to = include them.

* Implement some ruby-tools l= ike commands in ruby-mode

ruby-tools is a sm= all package, that adds some extra code manipulation commands = https://github.com/r= ejeep/ruby-tools

The commands there need a bit of polish, but are generally a step in= the right direction IMO.
A least of a few of the commands there deserve to be part of ruby-mode i= tself, so more users would get to use them.

I have other crazier ideas, but I'll s= top for now :-)

I'd like to hear what you t= hink=21 

I can make the necessary chan= ges and provide patches if you think that my suggestions make sense.

-- 
Cheers,
=
Bozhidar

--51c478ae_1d91467c_b3--