From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Croix Newsgroups: gmane.emacs.bugs Subject: bug#12769: 24.2; Files won't save on Macintosh/Mountain Lion Date: Wed, 31 Oct 2012 10:07:04 -0500 Message-ID: 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> <5090D62C.8010207@gmx.at> <5090FD10.3070100@gmx.at> <09A63027-5F49-4F8D-AFD8-D2904FFCC341@mac.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="Boundary_(ID_MjpKf8drUCi6tia2b6tvwA)" X-Trace: ger.gmane.org 1351696062 2971 80.91.229.3 (31 Oct 2012 15:07:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Oct 2012 15:07:42 +0000 (UTC) Cc: 12769@debbugs.gnu.org, Andreas Schwab To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 31 16:07:51 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 1TTZtW-0002L9-4v for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Oct 2012 16:07:50 +0100 Original-Received: from localhost ([::1]:50756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTZtN-0001IW-J5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 Oct 2012 11:07:41 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTZtI-0001I5-JE for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 11:07:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTZt7-00015i-4H for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 11:07:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTZt7-00015Y-0B for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 11:07:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TTZve-0004BR-Cv for bug-gnu-emacs@gnu.org; Wed, 31 Oct 2012 11:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Croix Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Oct 2012 15:10:02 +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.135169618816058 (code B ref 12769); Wed, 31 Oct 2012 15:10:02 +0000 Original-Received: (at 12769) by debbugs.gnu.org; 31 Oct 2012 15:09:48 +0000 Original-Received: from localhost ([127.0.0.1]:41623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTZvP-0004Aw-SN for submit@debbugs.gnu.org; Wed, 31 Oct 2012 11:09:48 -0400 Original-Received: from st11p01mm-asmtpout002.mac.com ([17.172.204.237]:65420 helo=st11p01mm-asmtp002.mac.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TTZvL-0004Am-Of for 12769@debbugs.gnu.org; Wed, 31 Oct 2012 11:09:45 -0400 Original-Received: from [10.218.70.21] (corp.Cadence.COM [158.140.1.28]) by st11p01mm-asmtp002.mac.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Jan 3 2012)) with ESMTPSA id <0MCR003HEJBOBJ10@st11p01mm-asmtp002.mac.com> for 12769@debbugs.gnu.org; Wed, 31 Oct 2012 15:07:04 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855,1.0.431,0.0.0000 definitions=2012-10-31_03:2012-10-31, 2012-10-31, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1210310139 In-reply-to: <09A63027-5F49-4F8D-AFD8-D2904FFCC341@mac.com> X-Mailer: Apple Mail (2.1499) 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:66279 Archived-At: --Boundary_(ID_MjpKf8drUCi6tia2b6tvwA) Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT A quick follow up. Thanks to your input, I've rewritten the code, and it seems to do everything that I need it to do in 24.2. (add-hook 'write-file-hooks (lambda () (delete-trailing-whitespace) (if (not indent-tabs-mode) (untabify (point-min) (point-max))) nil)) Thanks again, John On Oct 31, 2012, at 9:50 AM, John Croix wrote: > Thanks for all the help and suggestions. Here's what I can tell you: > I've never programmed in LISP, so I picked this piece of code up from a friend who is. That's not an excuse for not trying to figure it out on my own. However, I hope that explains why I'll say that I have no idea what the lambda function does in LISP. I'm familiar with C++11's new lambda features, but the semantics of LISP... no clue. Looks like I'll need to become familiar with LISP. > The intent of the code was to do 2 things > Always delete trailing white space from any file > Untabify files for which indent-tabs-mode is nil. From what I understand, this variable is set to a non-nil value for makefile mode but isn't necessarily set for other modes. Thus, the prior statement sets indent-tabs-mode to nil for all modes that don't normally set it. > While it now looks like the code doesn't actually do the two things that I wanted it to do, it never stopped the process of writing files before. I'm using the same initialization file for emacs 23.4. It seems to me that this means that (1) untabify didn't return a result before or (2) the write operation didn't depend on a nil value return in order to write. So is this a bug in 23.4 that's fixed in 24.x? A feature change in 24.x for untabify or the write operation? > > Again, thanks for the helpful feedback. Sorry to submit a bug report on a user error. > > Regards, > John > > On Oct 31, 2012, at 5:27 AM, martin rudalics wrote: > >>> Or just use whitespace-mode. >> >> Indeed. Maybe we should improve the Emacs manual to tell more >> about its capabilities. >> >> martin >> > --Boundary_(ID_MjpKf8drUCi6tia2b6tvwA) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable A = quick follow up.  Thanks to your input, I've rewritten the code, = and it seems to do everything that I need it to do in = 24.2.
(add-hook = 'write-file-hooks 
  (lambda ()
  =   (delete-trailing-whitespace)
    (if (not = indent-tabs-mode)
      (untabify (point-min) = (point-max)))
    = nil))

Thanks = again,
John

On Oct 31, 2012, at 9:50 = AM, John Croix <jcroix@mac.com> wrote:

Thanks for all the help and = suggestions.  Here's what I can tell you:
  • I've never programmed in LISP, so I picked = this piece of code up from a friend who is.  That's not an excuse = for not trying to figure it out on my own.  However, I hope that = explains why I'll say that I have no idea what the lambda function does = in LISP.  I'm familiar with C++11's new lambda features, but the = semantics of LISP... no clue.  Looks like I'll need to become = familiar with LISP.
  • The intent of the code was to do 2 = things
    • Always delete trailing white space from any = file
    • Untabify files for which indent-tabs-mode is nil. =  =46rom what I understand, this variable is set to a non-nil value = for makefile mode but isn't necessarily set for other modes.  Thus, = the prior statement sets indent-tabs-mode to nil for all modes that = don't normally set it.
  • While it now looks like the code = doesn't actually do the two things that I wanted it to do, it never = stopped the process of writing files before.  I'm using the same = initialization file for emacs 23.4.  It seems to me that this means = that (1) untabify didn't return a result before or (2) the write = operation didn't depend on a nil value return in order to write. =  So is this a bug in 23.4 that's fixed in 24.x?  A feature = change in 24.x for untabify or the write = operation?

Again, thanks for the = helpful feedback.  Sorry to submit a bug report on a user = error.

Regards,
John

On Oct 31, 2012, at 5:27 AM, martin rudalics <rudalics@gmx.at> wrote:

Or just use whitespace-mode.

Indeed. =  Maybe we should improve the Emacs manual to tell more
about its = capabilities.

martin



= --Boundary_(ID_MjpKf8drUCi6tia2b6tvwA)--