unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15535: 24.3.50; basic-save-buffer should update buffer-file-coding-system value if the contents were written using different coding system
@ 2013-10-05 22:44 Dmitry Gutov
       [not found] ` <handler.15535.B.138101307530740.ack@debbugs.gnu.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Gutov @ 2013-10-05 22:44 UTC (permalink / raw)
  To: 15535

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

See here why it's useful:
http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00129.html

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))
    (unwind-protect
        (with-temp-buffer
          (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 "водка матрёшка селёдка")
        (save-buffer)
        ;; Fails here:
        (should (eq 'utf-8-unix buffer-file-coding-system)))
      (delete-file file))))

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





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-10-13 20:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-05 22:44 bug#15535: 24.3.50; basic-save-buffer should update buffer-file-coding-system value if the contents were written using different coding system Dmitry Gutov
     [not found] ` <handler.15535.B.138101307530740.ack@debbugs.gnu.org>
2013-10-05 23:09   ` 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) Dmitry Gutov
2013-10-06 16:51     ` Eli Zaretskii
2013-10-06 20:58       ` Dmitry Gutov
2013-10-07  2:52         ` Eli Zaretskii
2013-10-07  4:00           ` Dmitry Gutov
2013-10-07 14:59       ` Kenichi Handa
2013-10-13 12:06         ` Kenichi Handa
2013-10-13 16:48           ` Eli Zaretskii
2013-10-13 20:43             ` Dmitry Gutov

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).