unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Peter Milliken <peter.milliken@gmail.com>
Cc: 13432@debbugs.gnu.org
Subject: bug#13432: 24.2; File does not get saved when save-buffer called
Date: Sun, 13 Jan 2013 19:54:29 -0500	[thread overview]
Message-ID: <7qwqvglh2y.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <CAA0nDNvNaDXT5bg73nmU0crcehfvZLVTfjpA8kRsUkNUTWv-mw@mail.gmail.com> (Peter Milliken's message of "Mon, 14 Jan 2013 09:40:55 +1100")

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	other threads:[~2013-01-14  0:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-13 22:40 bug#13432: 24.2; File does not get saved when save-buffer called Peter Milliken
2013-01-14  0:54 ` Glenn Morris [this message]
2013-01-14  1:38 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7qwqvglh2y.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=13432@debbugs.gnu.org \
    --cc=peter.milliken@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).