GNU bug report logs - #13432
24.2; File does not get saved when save-buffer called

Previous Next

Package: emacs;

Reported by: Peter Milliken <peter.milliken <at> gmail.com>

Date: Mon, 14 Jan 2013 00:46:03 UTC

Severity: normal

Tags: notabug

Found in version 24.2

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #10 received at control <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Peter Milliken <peter.milliken <at> gmail.com>
Cc: 13432-done <at> debbugs.gnu.org
Subject: Re: bug#13432: 24.2; File does not get saved when save-buffer called
Date: Sun, 13 Jan 2013 20:38:56 -0500
tags 13432 notabug
thanks

> (defadvice python-mode (after minor-modes-for-python activate compile)
>   (add-hook 'local-write-file-hooks
>             '(lambda () (untabify (point-min) (point-max)))))

As Glenn explains, this is not a bug.  It's probably due to a change in
untabify which now returns a different value, but since the return value
of untabify is undocumented, this is not a bug/regression.

But while I'm here, I'll point out a few improvement to your above code:
- don't quote lambda.
- use python-mode-hook rather than defadvice.
- use before-save-hook rather than local-write-file-hooks (this will
  also fix your problem).

I.e.

  (add-hook 'python-mode-hook
            (lambda ()
              (add-hook 'before-save-hook
                        (lambda () (untabify (point-min) (point-max)))
                        nil 'local)))

-- Stefan




This bug report was last modified 12 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.