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: trunk r115036: * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding): Use Date: Fri, 08 Nov 2013 21:16:33 +0200 Message-ID: <527D3891.3010906@yandex.ru> References: <87zjpehj1t.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 1383938486 24462 80.91.229.3 (8 Nov 2013 19:21:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Nov 2013 19:21:26 +0000 (UTC) Cc: emacs-devel To: Bozhidar Batsov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 08 20:21:31 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 1VercY-00077O-5M for ged-emacs-devel@m.gmane.org; Fri, 08 Nov 2013 20:21:30 +0100 Original-Received: from localhost ([::1]:48078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VercX-0004zB-Kc for ged-emacs-devel@m.gmane.org; Fri, 08 Nov 2013 14:21:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VerYt-0004Ya-UV for emacs-devel@gnu.org; Fri, 08 Nov 2013 14:21:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VerXp-0001V6-Ri for emacs-devel@gnu.org; Fri, 08 Nov 2013 14:17:43 -0500 Original-Received: from mail-ea0-x232.google.com ([2a00:1450:4013:c01::232]:49140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VerXp-0001Ur-K3 for emacs-devel@gnu.org; Fri, 08 Nov 2013 14:16:37 -0500 Original-Received: by mail-ea0-f178.google.com with SMTP id a10so1100478eae.37 for ; Fri, 08 Nov 2013 11:16:36 -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=v6nZjHA7i1NlrctnHvjeQogRFty+KChw3bK8rcpXbU4=; b=Kh9ovhJGknBIMTb58TFL+3J84Q0UGMcmO7B9LMAlTaY987/+sCfbe443cfLHjarFYt RatEM9XNAzzEnmf00JXRI2kGGTQFwgtVJ7/TSeHINDbfQEbBMNz4fqk1jOVRmby7eD1Q XwuKG9kv2d/uqBqnn0inMfw4JKYagLWUyVHjvdOvdYsyovWDc/HycvRtgFljvwLF01EX emz5vtLe1aF1XIqbHgOl+y8639xeU/ItXdV9uzyAONlhurL8Iyq/GxJfP7KVXNDtNRZx 4+k7hBX4wfx7vdWUUppG+tUhpmqo5EggNFkGsxFhzExFTc7H7TobCtUES228VKO3eUN1 cqiA== X-Received: by 10.15.50.195 with SMTP id l43mr18807733eew.30.1383938196718; Fri, 08 Nov 2013 11:16:36 -0800 (PST) Original-Received: from [192.168.10.2] (83-47-37.netrun.cytanet.com.cy. [83.168.47.37]) by mx.google.com with ESMTPSA id k7sm18110424eeg.13.2013.11.08.11.16.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Nov 2013 11:16:35 -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:c01::232 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:165078 Archived-At: 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.