Mercurial > hg > xemacs-beta
comparison lisp/mule/mule-cmds.el @ 4590:c83cab5a4f04
Display control characters using carets, invalid-sequence-coding-system
2009-01-31 Aidan Kehoe <kehoea@parhasard.net>
* mule/mule-cmds.el (finish-set-language-environment):
Treat control characters specially in the
invalid-sequence-coding-system handling, display them using the
caret notation.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sat, 31 Jan 2009 17:38:07 +0000 |
parents | 774e5c7522bf |
children | e0a8715fdb1f |
comparison
equal
deleted
inserted
replaced
4582:00ed9903a988 | 4590:c83cab5a4f04 |
---|---|
769 (funcall func))) | 769 (funcall func))) |
770 | 770 |
771 (let ((invalid-sequence-coding-system | 771 (let ((invalid-sequence-coding-system |
772 (get-language-info language-name 'invalid-sequence-coding-system)) | 772 (get-language-info language-name 'invalid-sequence-coding-system)) |
773 (disp-table (specifier-instance current-display-table)) | 773 (disp-table (specifier-instance current-display-table)) |
774 glyph) | 774 glyph string) |
775 (when (consp invalid-sequence-coding-system) | 775 (when (consp invalid-sequence-coding-system) |
776 (setq invalid-sequence-coding-system | 776 (setq invalid-sequence-coding-system |
777 (car invalid-sequence-coding-system))) | 777 (car invalid-sequence-coding-system))) |
778 (map-char-table | 778 (map-char-table |
779 #'(lambda (key entry) | 779 #'(lambda (key entry) |
780 (setq glyph (make-glyph | 780 (setq string (decode-coding-string (string entry) |
781 (vector | 781 invalid-sequence-coding-system)) |
782 'string :data | 782 ;; Treat control characters specially: |
783 (decode-coding-string (string entry) | 783 (when (string-match "^[\x00-\x1f\x80-\x9f]$" string) |
784 invalid-sequence-coding-system)))) | 784 (setq string (format "^%c" (+ ?@ (aref string 0))))) |
785 (setq glyph (make-glyph (vector 'string :data string))) | |
785 (set-glyph-face glyph 'unicode-invalid-sequence-warning-face) | 786 (set-glyph-face glyph 'unicode-invalid-sequence-warning-face) |
786 (put-char-table key glyph disp-table) | 787 (put-char-table key glyph disp-table) |
787 nil) | 788 nil) |
788 unicode-error-default-translation-table)) | 789 unicode-error-default-translation-table)) |
789 | 790 |