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 19:58:38 +0200 Message-ID: <87zjpehj1t.fsf@yandex.ru> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1383933685 2201 80.91.229.3 (8 Nov 2013 18:01:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Nov 2013 18:01:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Bozhidar Batsov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 08 19:01:27 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 1VeqN3-0004wf-Qv for ged-emacs-devel@m.gmane.org; Fri, 08 Nov 2013 19:01:25 +0100 Original-Received: from localhost ([::1]:47276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeqN3-0004Ud-Hx for ged-emacs-devel@m.gmane.org; Fri, 08 Nov 2013 13:01:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeqLj-0003xd-2l for emacs-devel@gnu.org; Fri, 08 Nov 2013 13:01:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeqKW-0004N2-4H for emacs-devel@gnu.org; Fri, 08 Nov 2013 13:00:02 -0500 Original-Received: from mail-ea0-x22b.google.com ([2a00:1450:4013:c01::22b]:43836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeqKV-0004Mt-TH for emacs-devel@gnu.org; Fri, 08 Nov 2013 12:58:48 -0500 Original-Received: by mail-ea0-f171.google.com with SMTP id h15so1073152eak.16 for ; Fri, 08 Nov 2013 09:58:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=SeHVZsJg5v6mc0a+J0AkPK5VO/1l52qsw5DL/Ul92Dk=; b=W5E+Y1lsIuXChtmWdAeaAGDFAntBxchoaAQdG217siH+NrvZ883K7ZcDQbJCQLgTyE JAZoIEWSknK3w7M83jXdD0gTWUfGCbHn+wYg1L3gNSok/IOp8iHE08WxaQ3xMfpNqErY +xiFP+Qo/+RX14Ca7oMmYwmu50q+ibZNQEpps1hZ36nH0IyBQSW5p6gQLhqx3WyFizq2 126Ja999NG9jBRN8XlMU9X12FURzhvkRjydYmPCK8nLqrbZ1zCxKxzQ14e/4xFHAzlFT igKtjO5+zAQzOcdDtUAqt4MwVMMpJJ5CW92YbNOkHgQpvhTHGZjECcAuKT9WoxRf+Ri+ w9aQ== X-Received: by 10.15.10.6 with SMTP id f6mr4262826eet.57.1383933526392; Fri, 08 Nov 2013 09:58:46 -0800 (PST) Original-Received: from axl (93-245-142.netrun.cytanet.com.cy. [93.109.245.142]) by mx.google.com with ESMTPSA id 43sm859259eeg.6.2013.11.08.09.58.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 08 Nov 2013 09:58:45 -0800 (PST) In-Reply-To: (Bozhidar Batsov's message of "Fri, 08 Nov 2013 16:03:13 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::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:165075 Archived-At: Bozhidar Batsov writes: > ------------------------------------------------------------ > revno: 115036 > revision-id: bozhidar@batsov.com-20131108160155-qqqzvzyv7buc7r1v > parent: dgutov@yandex.ru-20131108112252-g8bofo4jray5k45v > committer: Bozhidar Batsov > 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))))