emacs-devel
[Top][All Lists]
Advanced

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

Re: Subject: [PATCH] * lisp/progmodes/ruby-mode.el: Set `ruby-insert-enc


From: Bozhidar Batsov
Subject: Re: Subject: [PATCH] * lisp/progmodes/ruby-mode.el: Set `ruby-insert-encoding-magic-comment' to nil by default.
Date: Sat, 2 Nov 2013 12:38:48 +0200

On 2 November 2013 02:00, Dmitry Gutov <address@hidden> wrote:
Bozhidar Batsov <address@hidden> writes:

> Since Ruby 1.8 reached end of life in the summer and most projects these days use Ruby 2.0 (which
> assumes source files use utf8 by default) having `ruby-insert-encoding-magic-comment’ doesn’t make
> much sense. Most people just disable it anyways, so why not have it disabled by default?

AFAICT, even in 2.0 it's still important for Japanese users who may use
an encoding other than UTF-8.

Disabling the addition of magic comment when UTF-8 is used should be
done via adding '(utf-8 . nil) to `ruby-encoding-map', and even that I
can't support personally since our team, at work, is still on 1.9.3.

Also see http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00236.html

Disabling this by default is not directly related to improving it. While I think your suggestions for running this in an after-save-hook are sound, I feel that the majority of Ruby programmers out there no longer need this, so it doesn't make sense to have it on by default just to make people search how to disable it (unless it stops messing with files that are already using utf-8, which as you note is problematic for users of Ruby 1.9). 

P.S. I also think we should insert the comment in Ruby style (e.g. "# encoding: utf-8") instead of the current Emacs style encoding comment (or make this customizable).  


reply via email to

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