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: Glenn Morris
Subject: bug#13432: 24.2; File does not get saved when save-buffer called
Date: Sun, 13 Jan 2013 19:54:29 -0500
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Peter Milliken wrote:

> This behaviour started with Emacs 24.1 - it does not happen on earlier
> versions.
>
> In my .emacs I defadvice several major modes to include a call to
> untabify in the local-write-file-hooks. With this version of Emacs, the
> defadvice
> seems to trigger a bug where the message line states the file has been
> saved when it has not been saved - the status line indicates it is still
> in a modified state as well.
>
> Minimal/sample code that triggers/illustrates this bug is:
>
> (defadvice python-mode (after minor-modes-for-python activate compile)
>   (add-hook 'local-write-file-hooks '(lambda () (untabify (point-min)
> (point-max)))))

Please read the doc of local-write-file-hooks:

  This variable is obsolete since 22.1;
  use `write-file-functions' instead.

>From write-file-functions:

If one of them returns non-nil, the file is considered already written
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^
and the rest are not called.

So: ensure that any functions you add return nil. The return value of
untabify is unspecfied (ie, could be anything).





reply via email to

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