[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15535: 24.3.50; basic-save-buffer should update buffer-file-coding-s

From: Dmitry Gutov
Subject: bug#15535: 24.3.50; basic-save-buffer should update buffer-file-coding-system value if the contents were written using different coding system
Date: Sun, 06 Oct 2013 01:44:09 +0300

Otherwise it's hard to find out which coding system was used, after all.

See here why it's useful:

The following test passes in Emacs 24.3 but fails on trunk:

(ert-deftest save-buffer-updates-buffer-file-coding-system ()
  (let ((file (expand-file-name "foo" temporary-file-directory))
        (default-buffer-file-coding-system 'utf-8-unix))
          (insert "abcdef\n")
          (write-file file))
      (with-current-buffer (find-file-noselect file)
        (should (eq 'undecided (coding-system-change-eol-conversion
                                buffer-file-coding-system nil)))
        (insert "водка матрёшка селёдка")
        ;; Fails here:
        (should (eq 'utf-8-unix buffer-file-coding-system)))
      (delete-file file))))

In GNU Emacs (x86_64-unknown-linux-gnu, GTK+ Version 3.6.4)
 of 2013-10-04 on axl
Bzr revision: 114513 address@hidden
Windowing system distributor `The X.Org Foundation', version 11.0.11303000
System Description:     Ubuntu 13.04

reply via email to

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