GNU bug report logs - #15535
24.3.50; basic-save-buffer should update buffer-file-coding-system value if the contents were written using different coding system

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Sat, 5 Oct 2013 22:45:02 UTC

Severity: normal

Found in version 24.3.50

Fixed in version 24.4

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 15535 <at> debbugs.gnu.org, handa <at> gnu.org
Subject: Re: bug#15535: Acknowledgement (24.3.50;	basic-save-buffer should
 update buffer-file-coding-system value if	the contents were written using
 different coding system)
Date: Mon, 07 Oct 2013 07:00:42 +0300
On 07.10.2013 05:52, Eli Zaretskii wrote:
> Not here, it doesn't.  I see 'undecided'.  And that is part of the
> problem.

True, sorry. It worked for me previously, but I guess the value was 
similarly spoiled by some other function in after-save-hook.

>> `ruby-mode-set-encoding' is moved to after-save-hook, as long as it's
>> not the first function in this hook (and I can't ensure that it is), the
>> previous functions can also do some I/O and thus change
>> last-coding-system-used's value.
>
> You can always take the value of last-coding-system-used as the first
> thing you do.

If "I" am a function inside after-save-hook, I don't control the "first 
thing".

But now I see that `basic-save-buffer' does save the value of 
`last-coding-system-used' to either `save-buffer-coding-system' or 
`buffer-file-coding-system', depending on whether the former is non-nil.

So I can use those, and the problem is reduced to having the right 
`last-coding-system-used' value set.




This bug report was last modified 11 years and 227 days ago.

Previous Next


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