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: Wed, 6 Nov 2013 19:10:11 +0200

Here's a patch for making the comment format customizable. How does it look to you?


I'll send later another patch with the always-utf8 customization we discussed.


On 4 November 2013 15:40, Bozhidar Batsov <address@hidden> wrote:
OK. I'll implement the discussed customizations.


On 3 November 2013 11:22, Dmitry Gutov <address@hidden> wrote:
Bozhidar Batsov <address@hidden> writes:

> Sorry about the lack of clarity - I meant that if you have a Ruby 2.0 only project you likely don't
> want the insertion of utf-8 coding comments.
>
> ...
>
> Yeah, I'm aware of that. In my open source projects I still keep 1.9 compatibility and generally
> include those cookies in every file. Since I want them included unconditionally (AFAIK many other
> Ruby programmers do this as well for the sake of consistency) the magic-comment functionality in
> ruby-mode is quite useless to me even for Ruby 1.9.

Now I get it, thanks for the explanation.

> If we add the option to include the magic
> comment unconditionally that might increase the usefulness of the
> setting for some people.

Sure, as long as it's not on by default. For example, add a new possible
value of `ruby-insert-encoding-magic-comment': `always'. Or `always-utf8'.

In this case, `ruby-mode-set-encoding' might short-circuit the whole
encoding detection logic and just always write `coding: utf-8'.


Attachment: 0001-lisp-progmodes-ruby-mode.el-ruby-mode-set-encoding.patch
Description: Binary data


reply via email to

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