comparison lisp/coding.el @ 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 33b8c874b2c8
children 257b468bf2ca
comparison
equal deleted inserted replaced
4621:127dbf03e1af 4622:8cbca852bcd4
587 function is an alist mapping coding system names to lists of individual 587 function is an alist mapping coding system names to lists of individual
588 buffer positions (not ranges) that the individual coding systems cannot 588 buffer positions (not ranges) that the individual coding systems cannot
589 encode. 589 encode.
590 590
591 If all coding systems in CODING-SYSTEM-LIST can encode the region, 591 If all coding systems in CODING-SYSTEM-LIST can encode the region,
592 this function returns t. This conflicts with the documented, but not 592 this function returns nil.
593 with the observed, GNU behavior.
594 593
595 If BEGIN is a string, `check-coding-systems-region' ignores END, and checks 594 If BEGIN is a string, `check-coding-systems-region' ignores END, and checks
596 whether the coding systems can encode BEGIN. The alist that is returned 595 whether the coding systems can encode BEGIN. The alist that is returned
597 uses zero-based string indices, not one-based buffer positions. 596 uses zero-based string indices, not one-based buffer positions.
598 597
617 (query-coding-region begin end coding-system) 616 (query-coding-region begin end coding-system)
618 (unless encoded 617 (unless encoded
619 (setq intermediate (list (coding-system-name coding-system))) 618 (setq intermediate (list (coding-system-name coding-system)))
620 (map-range-table range-lambda ranges) 619 (map-range-table range-lambda ranges)
621 (push (nreverse intermediate) result))) 620 (push (nreverse intermediate) result)))
622 finally return (or result t))))) 621 finally return result))))
623 (if (stringp begin) 622 (if (stringp begin)
624 (with-temp-buffer 623 (with-temp-buffer
625 (insert begin) 624 (insert begin)
626 (funcall thunk (point-min) (point-max) coding-system-list t)) 625 (funcall thunk (point-min) (point-max) coding-system-list t))
627 (check-argument-type #'integer-or-marker-p begin) 626 (check-argument-type #'integer-or-marker-p begin)