From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <525231EA.3040900@yandex.ru> References: <871u3z49ty.fsf@yandex.ru> <52509C0D.1000600@yandex.ru> <83vc1a5omh.fsf@gnu.org> <5251CF11.8080301@yandex.ru> <83mwml6bd5.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1381118480 25628 80.91.229.3 (7 Oct 2013 04:01:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Oct 2013 04:01:20 +0000 (UTC) Cc: 15535@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 07 06:01:22 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VT20Y-0008Cp-Dy for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2013 06:01:22 +0200 Original-Received: from localhost ([::1]:57266 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT20Y-0005q9-34 for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Oct 2013 00:01:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT20O-0005px-S6 for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2013 00:01:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VT20E-0000sU-I5 for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2013 00:01:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50587) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT20E-0000sL-FR for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2013 00:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VT20D-0000w3-Rl for bug-gnu-emacs@gnu.org; Mon, 07 Oct 2013 00:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Oct 2013 04:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15535 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15535-submit@debbugs.gnu.org id=B15535.13811184533576 (code B ref 15535); Mon, 07 Oct 2013 04:01:01 +0000 Original-Received: (at 15535) by debbugs.gnu.org; 7 Oct 2013 04:00:53 +0000 Original-Received: from localhost ([127.0.0.1]:58880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VT204-0000vb-8C for submit@debbugs.gnu.org; Mon, 07 Oct 2013 00:00:52 -0400 Original-Received: from mail-ea0-f171.google.com ([209.85.215.171]:34485) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VT200-0000vR-F1 for 15535@debbugs.gnu.org; Mon, 07 Oct 2013 00:00:49 -0400 Original-Received: by mail-ea0-f171.google.com with SMTP id n15so2903750ead.2 for <15535@debbugs.gnu.org>; Sun, 06 Oct 2013 21:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=WesNAzQowz2i5TGvKMf+Xdw5IRPPdlPJOdG89pVWBCM=; b=EBub8MgFDJOcZ9ICp4ca8moAg+fEon5TXeRxTI7/mOtO5Gshv6AimVogC90uBw+3Hx m3bbyzXLCzIVHSofl+6VhaVu6OB2ZNUvtNMLYoCJCBZToAA58Rilr520hnZFuGnJjFrZ ahzO5vR6MegqdJcgDf6tL1+IACiW3inbybaRJqR11MMA7E/Yq7McPxDGM1B6MD7RF4W8 33TZTV6lFuc3oD/BAw2d9noL1mrvvWtd3YyUU1n9iASu7ROiXUw0Vr4+nCPMrVkTHyd7 UM69LGkBFUnOhMjrz2YRwqXX33RDcfKzJ/c/FW2ZpGd378li365C3/T3seCydwDxodGN v+cg== X-Received: by 10.15.99.72 with SMTP id bk48mr46171089eeb.22.1381118447555; Sun, 06 Oct 2013 21:00:47 -0700 (PDT) Original-Received: from [192.168.10.2] (93-113-74.netrun.cytanet.com.cy. [93.109.113.74]) by mx.google.com with ESMTPSA id f49sm58174810eec.7.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 06 Oct 2013 21:00:46 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: <83mwml6bd5.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:78972 Archived-At: 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.