Mercurial > hg > xemacs-beta
comparison lisp/mule/mule-coding.el @ 4551:6812571bfcb9
Fix some bugs.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 13 Mar 2008 10:21:01 +0100 |
parents | 68d1ca56cffa |
children | d9fcb5442c95 |
comparison
equal
deleted
inserted
replaced
4550:1217f19ce196 | 4551:6812571bfcb9 |
---|---|
551 (check-argument-type #'coding-system-p | 551 (check-argument-type #'coding-system-p |
552 (setq coding-system (find-coding-system coding-system))) | 552 (setq coding-system (find-coding-system coding-system))) |
553 (check-argument-type #'integer-or-marker-p begin) | 553 (check-argument-type #'integer-or-marker-p begin) |
554 (check-argument-type #'integer-or-marker-p end) | 554 (check-argument-type #'integer-or-marker-p end) |
555 (let ((from-unicode | 555 (let ((from-unicode |
556 (coding-system-get coding-system '8-bit-fixed-query-from-unicode)) | 556 (or (coding-system-get coding-system '8-bit-fixed-query-from-unicode) |
557 (coding-system-get (coding-system-base coding-system) | |
558 '8-bit-fixed-query-from-unicode))) | |
557 (skip-chars-arg | 559 (skip-chars-arg |
558 (coding-system-get coding-system '8-bit-fixed-query-skip-chars)) | 560 (or (coding-system-get coding-system '8-bit-fixed-query-skip-chars) |
561 (coding-system-get (coding-system-base coding-system) | |
562 '8-bit-fixed-query-skip-chars))) | |
559 (ranges (make-range-table)) | 563 (ranges (make-range-table)) |
560 char-after fail-range-start fail-range-end previous-fail extent | 564 char-after fail-range-start fail-range-end previous-fail extent |
561 failed) | 565 failed) |
562 (check-type from-unicode hash-table) | 566 (check-type from-unicode hash-table) |
563 (check-type skip-chars-arg string) | 567 (check-type skip-chars-arg string) |
564 (save-excursion | 568 (save-excursion |
569 (when highlightp | |
570 (map-extents #'(lambda (extent ignored-arg) | |
571 (when (eq 'query-coding-warning-face | |
572 (extent-face extent)) | |
573 (delete-extent extent))) buffer begin end)) | |
565 (goto-char begin buffer) | 574 (goto-char begin buffer) |
566 (skip-chars-forward skip-chars-arg end buffer) | 575 (skip-chars-forward skip-chars-arg end buffer) |
567 (while (< (point buffer) end) | 576 (while (< (point buffer) end) |
568 (message | 577 (message |
569 "fail-range-start is %S, previous-fail %S, point is %S, end is %S" | 578 "fail-range-start is %S, previous-fail %S, point is %S, end is %S" |
586 ;; The character actually failed. | 595 ;; The character actually failed. |
587 (message "past the move through, point now %S" (point buffer)) | 596 (message "past the move through, point now %S" (point buffer)) |
588 (when errorp | 597 (when errorp |
589 (error 'text-conversion-error | 598 (error 'text-conversion-error |
590 (format "Cannot encode %s using coding system" | 599 (format "Cannot encode %s using coding system" |
591 (buffer-substring fail-range-start (point buffeR) | 600 (buffer-substring fail-range-start (point buffer) |
592 buffer)) | 601 buffer)) |
593 (coding-system-name coding-system))) | 602 (coding-system-name coding-system))) |
594 (put-range-table fail-range-start | 603 (put-range-table fail-range-start |
595 ;; If char-after is non-nil, we're not at | 604 ;; If char-after is non-nil, we're not at |
596 ;; the end of the buffer. | 605 ;; the end of the buffer. |
601 (when highlightp | 610 (when highlightp |
602 (message "highlighting") | 611 (message "highlighting") |
603 (setq extent (make-extent fail-range-start fail-range-end buffer)) | 612 (setq extent (make-extent fail-range-start fail-range-end buffer)) |
604 (set-extent-priority extent (+ mouse-highlight-priority 2)) | 613 (set-extent-priority extent (+ mouse-highlight-priority 2)) |
605 (set-extent-face extent 'query-coding-warning-face)) | 614 (set-extent-face extent 'query-coding-warning-face)) |
606 (skip-chars-forward skip-chars-arg end buffer)) | 615 (skip-chars-forward skip-chars-arg end buffer))) |
607 (message "about to give the result, ranges %S" ranges)) | 616 (message "about to give the result, ranges %S" ranges) |
608 (if failed | 617 (if failed |
609 (values nil ranges) | 618 (values nil ranges) |
610 (values t nil))))) | 619 (values t nil))))) |
611 | 620 |
612 ;;;###autoload | 621 ;;;###autoload |