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: Dmitry Gutov
Subject: Re: Subject: [PATCH] * lisp/progmodes/ruby-mode.el: Set `ruby-insert-encoding-magic-comment' to nil by default.
Date: Wed, 06 Nov 2013 23:45:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0

On 06.11.2013 19:10, Bozhidar Batsov wrote:
Here's a patch for making the comment format customizable. How does it
look to you?

There might be a problem with weird template formats a user would be technically allowed to choose: if the template doesn't match either of the regexps used in `ruby-mode-set-encoding', the coding comment will be added at the first line of the buffer, even if it already contains (the non-standard) one. Not sure if that's a real problem, but maybe we should relax the regexps and/or reject all non-matching templates.

Other than that, looks fine to me. Possible improvements, if you like:

1. Move "#" also inside the template. It'll make the code a bit simpler and get rid of the implicit requirement that the template starts with a space.

2. Add predefined values to the customize widget? (:type (choice ...)) Allow the user to choose between Emacs-style and Ruby-style.



reply via email to

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