bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#13432: 24.2; File does not get saved when save-buffer called


From: Stefan Monnier
Subject: bug#13432: 24.2; File does not get saved when save-buffer called
Date: Sun, 13 Jan 2013 20:38:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]