all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Bozhidar Batsov <bozhidar@batsov.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: trunk r115036: * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding): Use
Date: Fri, 08 Nov 2013 21:16:33 +0200	[thread overview]
Message-ID: <527D3891.3010906@yandex.ru> (raw)
In-Reply-To: <CAM9Zgm29+wpLAH4FWVj-ypgqT14HhJEBrdfYAbS2JGL=TDGxCA@mail.gmail.com>

On 08.11.2013 20:23, Bozhidar Batsov wrote:
> I had a last minute change of heart regarding this. Based on my
> observations much more Ruby hackers use ruby-style encoding comments, so
> I thought this makes more sense as a default. AFAIK the Emacs encoding
> comments made a lot of difference in the pre-Emacs 24 era, but are not
> that important now.

I don't really know the history of this feature, but it seems to be the 
most popular/useful for the Japanese users, and they're not very visible 
on emacs-devel or the bug tracker. Maybe it's nothing.

My stance is purely based on the long-standing (and often criticized, 
sure) Emacs tradition to not change the defaults without solid reasons.

>      > +  "The style of the magic encoding comment to use."
>      > +  :type '(choice
>      > +          (const :tag "Emacs Style" emacs)
>      > +          (const :tag "Ruby Style" ruby)
>      > +          (const :tag "Custom Style" custom))
>      > +  :group 'ruby)
>      > +
>      > +(defcustom ruby-custom-encoding-magic-comment-template "#
>     coding: %s"
>
>     The way this template is duplicated below for the `ruby' case doesn't
>     look too nice.  Since you went ahead with symbol-based customization,
>     why not drop the "custom" case?
>
>
> I'm not sure what exactly the problem is with the current code. Someone
> might want to use a different encoding format, so the custom option
> seems reasonable to me. The default value of the custom template doesn't
> really matter as users interested in using a custom format will surely
> alter it.

My point is:

1) The `custom' option won't be used too often, if at all.
2) Even if that option stays, using whole two variables is an overkill, 
you can just replace the symbols inside the :type form with their 
corresponding template values and thus eliminate the `case' form below.

>      > -                     (insert "# -*- coding: " coding-system "
>     -*-\n"))))
>      > +                     (let ((encoding-magic-comment-template
>      > +                            (case ruby-encoding-magic-comment-style
>      > +                              ('ruby "# coding: %s")
>      > +                              ('emacs "# -*- coding: %s -*-")
>      > +                              ('custom

These are rather minor issues, so I'm not going to argue them further.



  reply	other threads:[~2013-11-08 19:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1VeoWf-0002wa-2m@vcs.savannah.gnu.org>
2013-11-08 17:58 ` trunk r115036: * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding): Use Dmitry Gutov
2013-11-08 18:23   ` Bozhidar Batsov
2013-11-08 19:16     ` Dmitry Gutov [this message]
2013-11-08 19:04   ` Stefan Monnier
2013-11-08 19:48     ` Bozhidar Batsov
2013-11-08 20:35       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=527D3891.3010906@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=bozhidar@batsov.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.