Ar an cúigiú lá de mí Meitheamh, scríobh Stephen J. Turnbull: 
 Richard Zidlicky writes:
 
  > is this expected behaviour? Tested with 21.5.28 and 21.5.29
 
  >  rm -f xx.txt; gnuclient xx.txt     		      # -> coding system UTF8
  >  rm -f xx.txt; touch xx.txt ;gnuclient xx.txt      # -> coding system
Auto/undecided
 
 This is not expected.  It's not hard to imagine the code the leads to
 this result, but it's incorrect; we'll fix it.  (I don't see a hurry,
 it may take some time.  Patches welcome!)  The undecided coding system
 is a sentinel, and should always be changed as the end result of
 autodetection, presumably to default-buffer-file-coding-system in the
 case  
I’ve a patch below. 
  > Worse yet, upon saving no sensible coding is selected --
 
 This is a different bug (a user could set buffer-file-coding-system).
 In the case of buffer-file-coding-system(-for-write) being 'undecided
 or similar, the writer function (output might not be to a file) should
 error.
 
  > Worse yet, upon saving no sensible coding is selected - texts with
  > accents or foreign chars get munged.
 
 And this is a third bug.  I thought Aidan had fixed this, but I guess
 it's only for his new unibyte coding systems. 
No, not even for them. It’s in progress,
http://mid.gmane.org/18912.40510.593475.645687@parhasard.net is the bones of
it, but more work is needed, in particular implementing the checks for the
Win32-specific coding systems and erroring in the appropriate places when
data will be lost. My evenings and my weekends are my own, right now,
thankfully, I hope to see some progress this month. 
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1244319144 -3600
# Node ID 4062be55b55149a156a151b3ce4def2223427366
# Parent  8cef85a39d2c162abd60427022511be52b9880b3
Set buffer-file-coding-system more sensibly with zero-length files.
2009-06-06  Aidan Kehoe  <kehoea(a)parhasard.net>
	* code-files.el (insert-file-contents):
        If the file was zero-length, used-codesys (and thus
	buffer-file-coding-system) is undecided. Set it to a more sane
	value.
diff -r 8cef85a39d2c -r 4062be55b551 lisp/ChangeLog
--- a/lisp/ChangeLog	Sat Jun 06 17:20:21 2009 +0100
+++ b/lisp/ChangeLog	Sat Jun 06 21:12:24 2009 +0100
@@ -1,3 +1,10 @@
+2009-06-06  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* code-files.el (insert-file-contents): 
+        If the file was zero-length, used-codesys (and thus
+	buffer-file-coding-system) is undecided. Set it to a more sane
+	value.
+
 2009-06-06  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* files.el (cd): 
diff -r 8cef85a39d2c -r 4062be55b551 lisp/code-files.el
--- a/lisp/code-files.el	Sat Jun 06 17:20:21 2009 +0100
+++ b/lisp/code-files.el	Sat Jun 06 21:12:24 2009 +0100
@@ -443,6 +443,10 @@
 			       filename visit err)
 	   (signal (car err) (cdr err))))
 	(setq coding-system used-codesys)
+        ;; If the file was zero-length, used-codesys is undecided. Set it to
+        ;; a more sane value. 
+        (if (eq 'undecided (coding-system-type coding-system))
+            (setq coding-system (default-value 'buffer-file-coding-system)))
 	;; call any `post-read-conversion' for the coding system that
 	;; was used ...
 	(let ((func
-- 
¿Dónde estará ahora mi sobrino Yoghurtu Nghe, que tuvo que huir
precipitadamente de la aldea por culpa de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches