comparison lisp/international/mule-util.el @ 91967:39b7a7b122f8

(char-displayable-p): Fix for Latin-1 characters and terminal case.
author Kenichi Handa <handa@m17n.org>
date Wed, 20 Feb 2008 04:41:25 +0000
parents 606f2d163a64
children 889bc336b89b
comparison
equal deleted inserted replaced
91966:0858a8d28e8d 91967:39b7a7b122f8
354 "Return non-nil if we should be able to display CHAR. 354 "Return non-nil if we should be able to display CHAR.
355 On a multi-font display, the test is only whether there is an 355 On a multi-font display, the test is only whether there is an
356 appropriate font from the selected frame's fontset to display CHAR's 356 appropriate font from the selected frame's fontset to display CHAR's
357 charset in general. Since fonts may be specified on a per-character 357 charset in general. Since fonts may be specified on a per-character
358 basis, this may not be accurate." 358 basis, this may not be accurate."
359 (cond ((< char 256) 359 (cond ((< char 128)
360 ;; Single byte characters are always displayable. 360 ;; ASCII characters are always displayable.
361 t) 361 t)
362 ((not enable-multibyte-characters) 362 ((not enable-multibyte-characters)
363 ;; Maybe there's a font for it, but we can't put it in the buffer. 363 ;; Maybe there's a font for it, but we can't put it in the buffer.
364 nil) 364 nil)
365 ((display-multi-font-p) 365 ((display-multi-font-p)
366 ;; On a window system, a character is displayable if we have 366 ;; On a window system, a character is displayable if we have
367 ;; a font for that character in the default face of the 367 ;; a font for that character in the default face of the
368 ;; currently selected frame. 368 ;; currently selected frame.
369 (car (internal-char-font nil char))) 369 (car (internal-char-font nil char)))
370 (t 370 (t
371 (let ((coding 'iso-2022-7bit)) 371 ;; On a terminal, a character is displayable if the coding
372 ;; system for the terminal can encode it.
373 (let ((coding (terminal-coding-system)))
372 (if coding 374 (if coding
373 (let ((cs-list (coding-system-get coding :charset-list))) 375 (let ((cs-list (coding-system-get coding :charset-list)))
374 (cond 376 (cond
375 ((listp cs-list) 377 ((listp cs-list)
376 (catch 'tag 378 (catch 'tag