From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel 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 Message-ID: <527AB880.4040207@yandex.ru> References: <61BBE6C8D4D349B6963A0F429237A3A8@gmail.com> <87txfvad0a.fsf@yandex.ru> <52755D62.1070700@yandex.ru> <87wqkpalgl.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1383774359 13397 80.91.229.3 (6 Nov 2013 21:45:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Nov 2013 21:45:59 +0000 (UTC) Cc: emacs-devel To: Bozhidar Batsov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 06 22:46:03 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VeAvJ-0001t0-JW for ged-emacs-devel@m.gmane.org; Wed, 06 Nov 2013 22:46:01 +0100 Original-Received: from localhost ([::1]:36197 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeAvJ-0001dP-4n for ged-emacs-devel@m.gmane.org; Wed, 06 Nov 2013 16:46:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeAv7-0001dA-Du for emacs-devel@gnu.org; Wed, 06 Nov 2013 16:45:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeAuy-00005s-WA for emacs-devel@gnu.org; Wed, 06 Nov 2013 16:45:49 -0500 Original-Received: from mail-ee0-x22b.google.com ([2a00:1450:4013:c00::22b]:52963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeAuy-00005b-Ob for emacs-devel@gnu.org; Wed, 06 Nov 2013 16:45:40 -0500 Original-Received: by mail-ee0-f43.google.com with SMTP id b47so48400eek.30 for ; Wed, 06 Nov 2013 13:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=6PBmk1Qf0LPmZ8FNAPj3gZz5E/PvMFe9UgTrXzkKWvQ=; b=XqaGELcA0In1H070Ewoh4X5ZXNBn1URUGo4PSCeK2WEnPfP190O52UmB1czmGm1jQf 5gn3gRA12s0NPLGAtGe44vuqi0CAtTdK1ds68Uiqjxg9GQsTasZ4rdEWO37x3NRnrrZ2 NVIT0/V7dMutFYUt8ukZpAmWf93j7Uz6cTuaLpUW1H7YooV5RGVAlkGEIfi4/0fpsfZX 53x/DcF4V4NTT8PHz/1nCZMvAireMwH3UXQZVJAblD0rsGKFhvWBAmsbQdK1zr0xTMg0 tVu+BoQu/Skfd1TC2RHsf6ru4VPzMmbhOvvVcMFCea0aezcT0J+1NkMNZiKZFeKxALoO aERw== X-Received: by 10.15.110.75 with SMTP id cg51mr5896570eeb.42.1383774339045; Wed, 06 Nov 2013 13:45:39 -0800 (PST) Original-Received: from [192.168.10.2] (87-236-188.netrun.cytanet.com.cy. [87.228.236.188]) by mx.google.com with ESMTPSA id z12sm690158eev.6.2013.11.06.13.45.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Nov 2013 13:45:38 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165014 Archived-At: 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.