From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Small improvements to ruby-mode Date: Fri, 21 Jun 2013 15:10:44 -0400 Message-ID: References: <2A6700DEDCA640EF92B326002717596D@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371841856 5708 80.91.229.3 (21 Jun 2013 19:10:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Jun 2013 19:10:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: Bozhidar Batsov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 21 21:10:57 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 1Uq6jY-00080o-6C for ged-emacs-devel@m.gmane.org; Fri, 21 Jun 2013 21:10:56 +0200 Original-Received: from localhost ([::1]:35210 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uq6jX-00010x-HR for ged-emacs-devel@m.gmane.org; Fri, 21 Jun 2013 15:10:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uq6jQ-0000yv-1j for emacs-devel@gnu.org; Fri, 21 Jun 2013 15:10:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uq6jP-0005JX-0M for emacs-devel@gnu.org; Fri, 21 Jun 2013 15:10:47 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:33520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uq6jO-0005JS-SD for emacs-devel@gnu.org; Fri, 21 Jun 2013 15:10:46 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpZVy/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GDMEdBJEKA6R6gV6DEw X-IPAS-Result: Av4EABK/CFFFpZVy/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GDMEdBJEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="16896735" Original-Received: from 69-165-149-114.dsl.teksavvy.com (HELO pastel.home) ([69.165.149.114]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 21 Jun 2013 15:10:40 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id C931D62CF6; Fri, 21 Jun 2013 15:10:44 -0400 (EDT) In-Reply-To: <2A6700DEDCA640EF92B326002717596D@gmail.com> (Bozhidar Batsov's message of "Fri, 21 Jun 2013 19:00:46 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 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:160853 Archived-At: > * 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. That all sounds fine to me, tho I never use Ruby, so my opinion doesn't matter too much. > * 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)) These should be consolidated into a single regexp and should probably be made a bit tighter (e.g. don't put BadCapfile in ruby-mode). I'm not too happy about having so many different patterns, tho (even if consolidated into a single regexp). Why are so many different namings used? It sounds like the Ruby people consider that all the world is Ruby and other tools just have to deal with it. Would it have been so hard to add a .rb to all those file ? > * 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 We could integrate it into ruby-mode, of course. Stefan