unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Peter Milliken <peter.milliken@gmail.com>
Cc: 13432-done@debbugs.gnu.org
Subject: bug#13432: 24.2; File does not get saved when save-buffer called
Date: Sun, 13 Jan 2013 20:38:56 -0500	[thread overview]
Message-ID: <jwv38y4sg59.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAA0nDNvNaDXT5bg73nmU0crcehfvZLVTfjpA8kRsUkNUTWv-mw@mail.gmail.com> (Peter Milliken's message of "Mon, 14 Jan 2013 09:40:55 +1100")

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





      parent reply	other threads:[~2013-01-14  1:38 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
2013-01-14  1:38 ` Stefan Monnier [this message]

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=jwv38y4sg59.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=13432-done@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).