[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Small improvements to ruby-mode
From: |
Stefan Monnier |
Subject: |
Re: Small improvements to ruby-mode |
Date: |
Fri, 21 Jun 2013 15:10:44 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> * 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 <Foo>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
- Small improvements to ruby-mode, Bozhidar Batsov, 2013/06/21
- Re: Small improvements to ruby-mode,
Stefan Monnier <=
- Re: Small improvements to ruby-mode, Dmitry Gutov, 2013/06/21
- Re: Small improvements to ruby-mode, Bozhidar Batsov, 2013/06/22
- Re: Small improvements to ruby-mode, Dmitry Gutov, 2013/06/22
- Re: Small improvements to ruby-mode, Stefan Monnier, 2013/06/22
- Re: Small improvements to ruby-mode, Bozhidar Batsov, 2013/06/23
- Re: Small improvements to ruby-mode, Dmitry Gutov, 2013/06/23
- Re: Small improvements to ruby-mode, Bozhidar Batsov, 2013/06/24