changeset 4622:8cbca852bcd4

#'check-coding-systems-region: return nil on success, not t. lisp/ChangeLog addition: 2009-02-18 Aidan Kehoe <kehoea@parhasard.net> * coding.el (check-coding-systems-region): Return null on success, not t. See http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1723 tests/ChangeLog addition: 2009-02-18 Aidan Kehoe <kehoea@parhasard.net> * automated/query-coding-tests.el : Check that #'check-coding-systems-region returns null on success here, not t.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 18 Feb 2009 07:53:34 +0000
parents 127dbf03e1af
children a9f83990e6bf
files lisp/ChangeLog lisp/coding.el tests/ChangeLog tests/automated/query-coding-tests.el
diffstat 4 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Feb 17 13:42:36 2009 +0000
+++ b/lisp/ChangeLog	Wed Feb 18 07:53:34 2009 +0000
@@ -1,3 +1,9 @@
+2009-02-18  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* coding.el (check-coding-systems-region): 
+	Return null on success, not t. See
+	http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1723
+
 2009-02-17  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* mule/mule-cmds.el (finish-set-language-environment): 
--- a/lisp/coding.el	Tue Feb 17 13:42:36 2009 +0000
+++ b/lisp/coding.el	Wed Feb 18 07:53:34 2009 +0000
@@ -589,8 +589,7 @@
 encode.
 
 If all coding systems in CODING-SYSTEM-LIST can encode the region,
-this function returns t.  This conflicts with the documented, but not
-with the observed, GNU behavior.
+this function returns nil.
 
 If BEGIN is a string, `check-coding-systems-region' ignores END, and checks
 whether the coding systems can encode BEGIN.  The alist that is returned
@@ -619,7 +618,7 @@
                    (setq intermediate (list (coding-system-name coding-system)))
                    (map-range-table range-lambda ranges)
                    (push (nreverse intermediate) result)))
-               finally return (or result t)))))
+               finally return result))))
   (if (stringp begin)
       (with-temp-buffer
 	(insert begin)
--- a/tests/ChangeLog	Tue Feb 17 13:42:36 2009 +0000
+++ b/tests/ChangeLog	Wed Feb 18 07:53:34 2009 +0000
@@ -1,3 +1,8 @@
+2009-02-18  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* automated/query-coding-tests.el : Check that
+	#'check-coding-systems-region returns null on success here, not t.
+
 2009-02-17  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* automated/mule-tests.el (featurep): 
--- a/tests/automated/query-coding-tests.el	Tue Feb 17 13:42:36 2009 +0000
+++ b/tests/automated/query-coding-tests.el	Wed Feb 18 07:53:34 2009 +0000
@@ -413,9 +413,9 @@
               "check #'unencodable-char-position stops at 7 if 2000 asked for")
       ;; Now, #'check-coding-systems-region. 
       ;; UTF-8 should certainly be able to encode these characters:
-      (Assert (eq t (check-coding-systems-region (point-min) (point-max)
+      (Assert (null (check-coding-systems-region (point-min) (point-max)
                                                  '(utf-8)))
-              "check #'check-coding-systems-region gives t if encoding works")
+              "check #'check-coding-systems-region gives nil if encoding works")
       (Assert
        (equal '((iso-8859-1 257 258 259 260 261 262 263)
                 (windows-1252 129 130 131 132 133 134 135 136