comparison lisp/international/mule-util.el @ 90058:48f163b71dbf

(char-displayable-p): Check :charset-list property of CODING.
author Kenichi Handa <handa@m17n.org>
date Thu, 09 Dec 2004 12:37:05 +0000
parents f2ebccfa87d4
children 3ebd9bdb4fe5
comparison
equal deleted inserted replaced
90057:241d36dfc5ec 90058:48f163b71dbf
369 ;; On a window system, a character is displayable if we have 369 ;; On a window system, a character is displayable if we have
370 ;; a font for that character in the default face of the 370 ;; a font for that character in the default face of the
371 ;; currently selected frame. 371 ;; currently selected frame.
372 (car (internal-char-font nil char))) 372 (car (internal-char-font nil char)))
373 (t 373 (t
374 (let ((coding (terminal-coding-system))) 374 (let ((coding 'iso-2022-7bit))
375 (if coding 375 (if coding
376 (let ((safe-chars (coding-system-get coding 'safe-chars)) 376 (let ((cs-list (coding-system-get coding :charset-list)))
377 (safe-charsets (coding-system-get coding 'safe-charsets))) 377 (cond
378 (or (and safe-chars 378 ((listp cs-list)
379 (aref safe-chars char)) 379 (catch 'tag
380 (and safe-charsets 380 (mapc #'(lambda (charset)
381 (memq (char-charset char) safe-charsets))))))))) 381 (if (encode-char char charset)
382 (throw 'tag charset)))
383 cs-list)
384 nil))
385 ((eq cs-list 'iso-2022)
386 (catch 'tag2
387 (mapc #'(lambda (charset)
388 (if (and (plist-get (charset-plist charset)
389 :iso-final-char)
390 (encode-char char charset))
391 (throw 'tag2 charset)))
392 charset-list)
393 nil))
394 ((eq cs-list 'emacs-mule)
395 (catch 'tag3
396 (mapc #'(lambda (charset)
397 (if (and (plist-get (charset-plist charset)
398 :emacs-mule-id)
399 (encode-char char charset))
400 (throw 'tag3 charset)))
401 charset-list)
402 nil)))))))))
382 403
383 (provide 'mule-util) 404 (provide 'mule-util)
384 405
385 ;; Local Variables: 406 ;; Local Variables:
386 ;; coding: iso-2022-7bit 407 ;; coding: iso-2022-7bit