From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul R Newsgroups: gmane.emacs.devel Subject: ruby-mode : ruby-mode-set-encoding Date: Tue, 03 Mar 2009 14:46:49 +0100 Message-ID: <87tz6ak9bq.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1236088058 8826 80.91.229.12 (3 Mar 2009 13:47:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Mar 2009 13:47:38 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 03 14:48:55 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LeUzD-0002eq-FZ for ged-emacs-devel@m.gmane.org; Tue, 03 Mar 2009 14:48:43 +0100 Original-Received: from localhost ([127.0.0.1]:38082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeUxs-00046F-8O for ged-emacs-devel@m.gmane.org; Tue, 03 Mar 2009 08:47:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LeUxe-00041B-NH for emacs-devel@gnu.org; Tue, 03 Mar 2009 08:47:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LeUxc-0003zj-8B for emacs-devel@gnu.org; Tue, 03 Mar 2009 08:47:05 -0500 Original-Received: from [199.232.76.173] (port=46816 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LeUxc-0003zc-1n for emacs-devel@gnu.org; Tue, 03 Mar 2009 08:47:04 -0500 Original-Received: from ey-out-1920.google.com ([74.125.78.150]:23793) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LeUxb-00007o-JQ for emacs-devel@gnu.org; Tue, 03 Mar 2009 08:47:03 -0500 Original-Received: by ey-out-1920.google.com with SMTP id 4so476887eyg.24 for ; Tue, 03 Mar 2009 05:47:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :message-id:user-agent:mime-version:content-type; bh=ND4pApew9FARLJBJUf+hV9lbILI5BmnMWk92rc3eB08=; b=ezM6vHcWP7Wq3D+VkL89uhhQ5jApYpg0SiWmciY+XHcViw+3iE15Xoi7DF4rgwk21Q oydW+ae8r9qB6fe2ZJDgql9hUD5i3NQOkcEdQEFdNBcKxoL/5bonApHU935JQqyDSWhh UoKSqHPfFi1Ck/sR4+Aqs5XMGyndg6N2fKro8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; b=gVwiFrr06jQuT6D7zUEGOapuuyBxK+DWl4JWjyYEsN8dsei6SS+IkJmTidhmbj1Rag rArRnaGzFXFaHHP8D22BEewfHi+APjLnZQ3J96J9Tu5tTUOVKuY5/Vc/KbyvsKmn8a0l +YY5+RWIRiISxhasEKPyvaLO8eY2x8asxSUIE= Original-Received: by 10.216.29.196 with SMTP id i46mr206925wea.113.1236088021456; Tue, 03 Mar 2009 05:47:01 -0800 (PST) Original-Received: from ubuT42 (pdc35-1-82-242-132-111.fbx.proxad.net [82.242.132.111]) by mx.google.com with ESMTPS id c5sm2369393nfi.28.2009.03.03.05.46.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 03 Mar 2009 05:46:58 -0800 (PST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:109406 Archived-At: Hello list, ruby mode is now part of emacs. There is this particular function : (defun ruby-mode-set-encoding () "Insert a magic comment header with the proper encoding if necessary." ... and AFAIK only ruby mode use this type of thing. It is added to saving functions hooks : (add-hook (cond ((boundp 'before-save-hook) (make-local-variable 'before-save-hook) 'before-save-hook) ((boundp 'write-contents-functions) 'write-contents-functions) ((boundp 'write-contents-hooks) 'write-contents-hooks)) 'ruby-mode-set-encoding) I am not sure what the usecase is for this function but it writes useless cookies in the headers of my ruby files whenever they contain something else that ascii chars. Reading the code, it seems that the definition of "necessary" is not very clear. Does anybody know why this is necessary please ? If it is really required, I would suggest to add a customizable variable to disable this magic behaviour. thanks, -- Paul