unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: ruby-mode.el updated
       [not found] <864n8sj2h8.knu@iDaemons.org>
@ 2013-10-08 10:55 ` Dmitry Gutov
  2013-10-14  0:36   ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2013-10-08 10:55 UTC (permalink / raw)
  To: Akinori MUSHA; +Cc: emacs-devel

Hi Akinori,

On 07.10.2013 22:38, Akinori MUSHA wrote:

> I've made some improvements to ruby-mode-set-encoding in order to:
>
> - reflect the change of the default source encoding in Ruby 2.0
> - add support for prefer-utf-8 introduced in Emacs trunk
> - add support for japanese-cp932 which was causing a problem
>
>      https://github.com/ruby/ruby/commits/trunk/misc/ruby-mode.el

That's good timing, I've been trying to improve that function just recently:

http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00126.html
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15535

Your approach with explicitly following how the encoder works (looking 
up :prefer-utf-8 property, and defaulting to 
default-buffer-file-coding-system) is workable, but I'd rather move 
ruby-mode-set-encoding to after-save-hook and just use the exact 
encoding that was used to save the file (after #15535 is fixed, 
hopefully soon).

And speaking of "reflect the change of the default source encoding in 
Ruby 2.0", are you sure it's a good idea to do now?

Some people are still using Ruby 1.9.3 in production (myself included), 
so I'd rather the defaults were safe for this use case.

-- Dmitry



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ruby-mode.el updated
  2013-10-08 10:55 ` ruby-mode.el updated Dmitry Gutov
@ 2013-10-14  0:36   ` Dmitry Gutov
  2013-10-14 14:49     ` Akinori MUSHA
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2013-10-14  0:36 UTC (permalink / raw)
  To: Akinori MUSHA; +Cc: emacs-devel

On 08.10.2013 13:55, Dmitry Gutov wrote:
> Your approach with explicitly following how the encoder works (looking
> up :prefer-utf-8 property, and defaulting to
> default-buffer-file-coding-system) is workable, but I'd rather move
> ruby-mode-set-encoding to after-save-hook and just use the exact
> encoding that was used to save the file (after #15535 is fixed,
> hopefully soon).
>
> And speaking of "reflect the change of the default source encoding in
> Ruby 2.0", are you sure it's a good idea to do now?
>
> Some people are still using Ruby 1.9.3 in production (myself included),
> so I'd rather the defaults were safe for this use case.

I've installed your changes, aside from those mentioned above, in 
revision 114654. Please test and see if I've missed anything.

Calling `ruby-mode-set-encoding' in `after-save-hook' is a bit 
questionable, but this way we don't depend on low-level details of how 
coding systems in Emacs work.

One drawback that I've seen so far is that `flymake-after-save-hook' 
usually ends up before `ruby-mode-set-encoding', so it will show an 
error, once.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ruby-mode.el updated
  2013-10-14  0:36   ` Dmitry Gutov
@ 2013-10-14 14:49     ` Akinori MUSHA
  0 siblings, 0 replies; 3+ messages in thread
From: Akinori MUSHA @ 2013-10-14 14:49 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1389 bytes --]

Hi,

At Mon, 14 Oct 2013 03:36:46 +0300,
Dmitry Gutov wrote:
> On 08.10.2013 13:55, Dmitry Gutov wrote:
> > Your approach with explicitly following how the encoder works (looking
> > up :prefer-utf-8 property, and defaulting to
> > default-buffer-file-coding-system) is workable, but I'd rather move
> > ruby-mode-set-encoding to after-save-hook and just use the exact
> > encoding that was used to save the file (after #15535 is fixed,
> > hopefully soon).
> >
> > And speaking of "reflect the change of the default source encoding in
> > Ruby 2.0", are you sure it's a good idea to do now?
> >
> > Some people are still using Ruby 1.9.3 in production (myself included),
> > so I'd rather the defaults were safe for this use case.
>
> I've installed your changes, aside from those mentioned above, in
> revision 114654. Please test and see if I've missed anything.

Thank you so much!

OK, I'll test it out on Emacs trunk and see how the amount of
compatibility code can be reduced.

> Calling `ruby-mode-set-encoding' in `after-save-hook' is a bit
> questionable, but this way we don't depend on low-level details of how
> coding systems in Emacs work.

OK.

> One drawback that I've seen so far is that `flymake-after-save-hook'
> usually ends up before `ruby-mode-set-encoding', so it will show an
> error, once.

I think it's a minor problem.

--
Akinori MUSHA / https://akinori.org/

[-- Attachment #2: OpenPGP Digital Signature --]
[-- Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-14 14:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <864n8sj2h8.knu@iDaemons.org>
2013-10-08 10:55 ` ruby-mode.el updated Dmitry Gutov
2013-10-14  0:36   ` Dmitry Gutov
2013-10-14 14:49     ` Akinori MUSHA

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).