From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: Emacs removes whitespaces at the end of lines Date: Mon, 03 Aug 2009 13:20:50 +0200 Message-ID: <87my6hnnxp.fsf@thinkpad.tsdh.de> References: <87d47d8adt.wl%anselm.helbig+news2009@googlemail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249298498 29399 80.91.229.12 (3 Aug 2009 11:21:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Aug 2009 11:21:38 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 03 13:21:32 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MXvbf-00049H-Gj for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Aug 2009 13:21:31 +0200 Original-Received: from localhost ([127.0.0.1]:59221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXvbe-0002KI-Nm for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Aug 2009 07:21:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXvbI-0002K1-Ax for help-gnu-emacs@gnu.org; Mon, 03 Aug 2009 07:21:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXvbD-0002Jc-RM for help-gnu-emacs@gnu.org; Mon, 03 Aug 2009 07:21:07 -0400 Original-Received: from [199.232.76.173] (port=44929 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXvbD-0002JZ-Op for help-gnu-emacs@gnu.org; Mon, 03 Aug 2009 07:21:03 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:56410 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MXvbD-0002Zx-Cz for help-gnu-emacs@gnu.org; Mon, 03 Aug 2009 07:21:03 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MXvb5-0004x3-UC for help-gnu-emacs@gnu.org; Mon, 03 Aug 2009 11:20:55 +0000 Original-Received: from 141.26.94.22 ([141.26.94.22]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Aug 2009 11:20:55 +0000 Original-Received: from tassilo by 141.26.94.22 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 03 Aug 2009 11:20:55 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 141.26.94.22 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:66CuyA4utITsttmfxwTZc/k6JBs= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:66700 Archived-At: Anselm Helbig writes: Hi! >> > Please poste the relevant lines of rails-mode, then we'll see if >> > they are the culprit. >> >> Here are the relevant lines: (untabify-file.el) >> >> [...] >> >> (add-hook 'write-file-hooks 'untabify-before-write) The right approach (if it's really a convention for rails code) would be to call (add-hook 'write-file-hooks 'untabify-before-write nil t) inside the `rails-mode' function. The last parameter to `add-hook' makes this hook buffer-local, so the untabify function would only be run when saving a file that is in rails-mode. > Yes, unfortunately emacs-rails behaves more like rails and not like a > well-behaved, humble emacs extension should: it just turns on a lot of > behavior, assuming that you'll probably like it. I think you (or F. Unglaub) should send a bug report to the rails-mode devs. Modes must not change global settings. > If you want to keep emacs-rails and don't want to remove the line > containing the call to `add-hook', you can just remove the hook after > untabify-file is loaded: > > (eval-after-load "untabify-file" > '(remove-hook 'write-file-hooks 'untabify-before-write)) Yes, that's a workaround. Bye, Tassilo