emacs-devel
[Top][All Lists]
Advanced

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

Small improvements to ruby-mode


From: Bozhidar Batsov
Subject: Small improvements to ruby-mode
Date: Fri, 21 Jun 2013 19:00:46 +0300

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


reply via email to

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