comparison lisp/descr-text.el @ 90215:7217d5a385f8

(describe-char): Sync with the main trunk.
author Kenichi Handa <handa@m17n.org>
date Fri, 29 Jul 2005 07:24:40 +0000
parents 187d6a1f84f7
children 2d92f5c9d6ae
comparison
equal deleted inserted replaced
90214:460ee00505d5 90215:7217d5a385f8
407 (string-to-multibyte 407 (string-to-multibyte
408 (char-to-string char)))) 408 (char-to-string char))))
409 (text-properties-at pos)) 409 (text-properties-at pos))
410 char char char)) 410 char char char))
411 ("preferred charset" 411 ("preferred charset"
412 ,(symbol-name charset) 412 ,`(widget-create 'link
413 :notify (lambda (&rest ignore)
414 (describe-character-set ',charset))
415 ,(symbol-name charset))
413 ,(format "(%s)" (charset-description charset))) 416 ,(format "(%s)" (charset-description charset)))
414 ("code point" 417 ("code point"
415 ,(if (integerp code) 418 ,(let ((str (if (integerp code)
416 (format (if (< code 256) "0x%02X" "0x%04X") code) 419 (format (if (< code 256) "0x%02X" "0x%04X") code)
417 (format "0x%04X%04X" (car code) (cdr code)))) 420 (format "0x%04X%04X" (car code) (cdr code)))))
421 (if (<= (charset-dimension charset) 2)
422 `(widget-create
423 'link
424 :notify (lambda (&rest ignore)
425 (list-charset-chars ',charset)
426 (with-selected-window
427 (get-buffer-window "*Character List*" 0)
428 (goto-char (point-min))
429 (forward-line 2) ;Skip the header.
430 (let ((case-fold-search nil))
431 (if (search-forward ,(char-to-string char)
432 nil t)
433 (goto-char (match-beginning 0))))))
434 ,str)
435 str)))
418 ("syntax" 436 ("syntax"
419 ,(let ((syntax (syntax-after pos))) 437 ,(let ((syntax (syntax-after pos)))
420 (with-temp-buffer 438 (with-temp-buffer
421 (internal-describe-syntax-value syntax) 439 (internal-describe-syntax-value syntax)
422 (buffer-string)))) 440 (buffer-string))))
494 (car display) (cdr display))) 512 (car display) (cdr display)))
495 "no font available") 513 "no font available")
496 (if display 514 (if display
497 (format "terminal code %s" display) 515 (format "terminal code %s" display)
498 "not encodable for terminal")))))) 516 "not encodable for terminal"))))))
517 ,@(let ((face
518 (if (not (or disp-vector composition))
519 (cond
520 ((and show-trailing-whitespace
521 (save-excursion (goto-char pos)
522 (looking-at "[ \t]+$")))
523 'trailing-whitespace)
524 ((and nobreak-char-display char (eq char '#xa0))
525 'nobreak-space)
526 ((and nobreak-char-display char (eq char '#xad))
527 'escape-glyph)
528 ((and (< char 32) (not (memq char '(9 10))))
529 'escape-glyph)))))
530 (if face (list (list "hardcoded face"
531 `(widget-create
532 'link
533 :notify (lambda (&rest ignore)
534 (describe-face ',face))
535 ,(format "%s" face))))))
499 ,@(let ((unicodedata (describe-char-unicode-data char))) 536 ,@(let ((unicodedata (describe-char-unicode-data char)))
500 (if unicodedata 537 (if unicodedata
501 (cons (list "Unicode data" " ") unicodedata))))) 538 (cons (list "Unicode data" " ") unicodedata)))))
502 (setq max-width (apply #'max (mapcar #'(lambda (x) (length (car x))) 539 (setq max-width (apply #'max (mapcar #'(lambda (x)
540 (if (cadr x) (length (car x)) 0))
503 item-list))) 541 item-list)))
504 (with-output-to-temp-buffer "*Help*" 542 (with-output-to-temp-buffer "*Help*"
505 (with-current-buffer standard-output 543 (with-current-buffer standard-output
506 (set-buffer-multibyte multibyte-p) 544 (set-buffer-multibyte multibyte-p)
507 (let ((formatter (format "%%%ds:" max-width))) 545 (let ((formatter (format "%%%ds:" max-width)))