From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#12769: 24.2; Files won't save on Macintosh/Mountain Lion Date: Wed, 31 Oct 2012 08:41:32 +0100 Message-ID: <5090D62C.8010207@gmx.at> References: <66AC6A79-0B90-4ACC-B861-DCA203F62EA8@mac.com> <36918149-9C7B-48B4-8043-9EB58342EB5A@swipnet.se> <9D6FF1F6-2EB1-4FA1-A194-A8C47D98558A@mac.com> <928CF6C4-2604-4B9A-9DC6-CBED7ECD64B5@mac.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1351669357 27343 80.91.229.3 (31 Oct 2012 07:42:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Oct 2012 07:42:37 +0000 (UTC) Cc: 12769@debbugs.gnu.org To: John Croix Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 31 08:42:44 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1TTSwm-0002KG-4t for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Oct 2012 08:42:44 +0100 Original-Received: from localhost ([::1]:33625 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTSwd-0000pq-LK for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Oct 2012 03:42:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTSwW-0000pL-3P for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 03:42:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTSwU-0002w6-I6 for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 03:42:27 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTSwU-0002w2-EZ for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 03:42:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TTSyz-0001WL-Sd for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 03:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Oct 2012 07:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12769 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 12769-submit@debbugs.gnu.org id=B12769.13516694595784 (code B ref 12769); Wed, 31 Oct 2012 07:45:01 +0000 Original-Received: (at 12769) by debbugs.gnu.org; 31 Oct 2012 07:44:19 +0000 Original-Received: from localhost ([127.0.0.1]:40735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTSyI-0001VE-UN for submit@debbugs.gnu.org; Wed, 31 Oct 2012 03:44:19 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:55370) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1TTSyF-0001V4-Rh for 12769@debbugs.gnu.org; Wed, 31 Oct 2012 03:44:17 -0400 Original-Received: (qmail invoked by alias); 31 Oct 2012 07:41:37 -0000 Original-Received: from 62-47-46-176.adsl.highway.telekom.at (EHLO [62.47.46.176]) [62.47.46.176] by mail.gmx.net (mp031) with SMTP; 31 Oct 2012 08:41:37 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+kfEQdhJSkEAlGQ3WxTSlPCM8bCzi4N8PygcX89m BwYS24KIao8vJ8 In-Reply-To: <928CF6C4-2604-4B9A-9DC6-CBED7ECD64B5@mac.com> X-Y-GMX-Trusted: 0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:66263 Archived-At: > I tracked the problem down to the following (in red): > (setq-default indent-tabs-mode nil) > (add-hook 'write-file-hooks > (lambda () > (if (not indent-tabs-mode) > (untabify (point-min) (point-max)) > (delete-trailing-whitespace)))) > So, is this a bug or is the untabify command no longer supported? If > it's now a bug, this should now be reproducible. If it's an obsolete > package, do you have any suggestions for a replacement? Properly indented, the `add-hook' form above here appears as (add-hook 'write-file-hooks (lambda () (if (not indent-tabs-mode) (untabify (point-min) (point-max)) (delete-trailing-whitespace)))) so if `indent-tabs-mode' is on, you delete trailing whitespace and if it's off, you untabify. Is this what you really want? Anyway, the problem seems that `untabify' returns non-nil and according to the doc-string of `write-file-hooks' we know that this is a List of functions to be called before writing out a buffer to a file. If one of them returns non-nil, the file is considered already written and the rest are not called. which is slightly ambiguous: One might think that if one of them returns non-nil Emacs will "not call the rest" but nevertheless save the buffer to its file. In your case writing the file is aborted because `untabify' returns the "current column `move-to-column' moved to" (whatever that is it seems to be non-nil). So maybe we should modify the return value of `untabify' (like in `delete-trailing-whitespace') or you should use (add-hook 'write-file-hooks (lambda () (if (not indent-tabs-mode) (progn (untabify (point-min) (point-max)) nil) (delete-trailing-whitespace)))) still modulo your real intentions of what that lambda is supposed to do. martin