Bozhidar Batsov <bozhidar@batsov.com> writes:
> ------------------------------------------------------------
> revno: 115036
> revision-id: bozhidar@batsov.com-20131108160155-qqqzvzyv7buc7r1v
> parent: dgutov@yandex.ru-20131108112252-g8bofo4jray5k45v
> committer: Bozhidar Batsov <bozhidar@batsov.com>
> branch nick: master
> timestamp: Fri 2013-11-08 18:01:55 +0200
> +(defcustom ruby-encoding-magic-comment-style 'ruby
I though we agreed that the default won't change: still Emacs. AFAIK,
it has the benefit of making sure Emacs uses the specified encoding.
I could be wrong, though.
> + "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?
> - (insert "# -*- coding: " coding-system " -*-\n"))))
> + (let ((encoding-magic-comment-template
> + (case ruby-encoding-magic-comment-style
> + ('ruby "# coding: %s")
> + ('emacs "# -*- coding: %s -*-")
> + ('custom ruby-custom-encoding-magic-comment-template))))