[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: trunk r115036: * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding
From: |
Dmitry Gutov |
Subject: |
Re: trunk r115036: * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding): Use |
Date: |
Fri, 08 Nov 2013 19:58:38 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Bozhidar Batsov <address@hidden> writes:
> ------------------------------------------------------------
> revno: 115036
> revision-id: address@hidden
> parent: address@hidden
> committer: Bozhidar Batsov <address@hidden>
> 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))))
- Re: trunk r115036: * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding): Use,
Dmitry Gutov <=