comparison lisp/international/kkc.el @ 51959:cfbd08e9b444

(kkc-show-conversion-list-update): Highlight the correct candidate in the message.
author Kenichi Handa <handa@m17n.org>
date Sat, 19 Jul 2003 01:23:50 +0000
parents 0d8b17d428b5
children 695cf19ef79e
comparison
equal deleted inserted replaced
51958:e244778fbafe 51959:cfbd08e9b444
547 (setq this-idx 1 msg nil) 547 (setq this-idx 1 msg nil)
548 (if (>= current-idx next-idx) 548 (if (>= current-idx next-idx)
549 ;; The currently selected conversion is after the list shown 549 ;; The currently selected conversion is after the list shown
550 ;; previously. We start calculation of message width from 550 ;; previously. We start calculation of message width from
551 ;; the conversion next of TO. 551 ;; the conversion next of TO.
552 (setq this-idx next-idx msg nil) 552 (setq this-idx next-idx msg nil)))
553 ;; The current conversion is in MSG. Just clear brackets
554 ;; around index number.
555 (if (string-match "<.>" msg)
556 (progn
557 (aset msg (match-beginning 0) ?\ )
558 (aset msg (1- (match-end 0)) ?\ )))))
559 (if (not msg) 553 (if (not msg)
560 (let ((len (length kkc-current-conversions)) 554 (let ((len (length kkc-current-conversions))
561 (max-width (window-width (minibuffer-window))) 555 (max-width (window-width (minibuffer-window)))
562 (width-table kkc-current-conversions-width) 556 (width-table kkc-current-conversions-width)
563 (width 0) 557 (width 0)
585 l (cdr l))) 579 l (cdr l)))
586 (aset first-slot 1 (setq next-idx idx)) 580 (aset first-slot 1 (setq next-idx idx))
587 (setq l (nthcdr this-idx kkc-current-conversions)) 581 (setq l (nthcdr this-idx kkc-current-conversions))
588 (setq msg (format " %c %s" 582 (setq msg (format " %c %s"
589 (aref kkc-show-conversion-list-index-chars 0) 583 (aref kkc-show-conversion-list-index-chars 0)
590 (car l)) 584 (propertize (car l)
585 'kkc-conversion-index this-idx))
591 idx (1+ this-idx) 586 idx (1+ this-idx)
592 l (cdr l)) 587 l (cdr l))
593 (while (< idx next-idx) 588 (while (< idx next-idx)
594 (setq msg (format "%s %c %s" 589 (setq msg (format "%s %c %s"
595 msg 590 msg
596 (aref kkc-show-conversion-list-index-chars 591 (aref kkc-show-conversion-list-index-chars
597 (- idx this-idx)) 592 (- idx this-idx))
598 (car l))) 593 (propertize (car l)
599 (setq idx (1+ idx) 594 'kkc-conversion-index idx))
595 idx (1+ idx)
600 l (cdr l))) 596 l (cdr l)))
601 (aset first-slot 2 msg))) 597 (aset first-slot 2 msg)))
598
599 ;; Highlight the current conversion.
602 (if (> current-idx 0) 600 (if (> current-idx 0)
603 (progn 601 (let ((pos 3)
604 ;; Highlight the current conversion by brackets. 602 (limit (length msg)))
605 (string-match (format " \\(%c\\) " 603 (remove-text-properties 0 (length msg) '(face nil) msg)
606 (aref kkc-show-conversion-list-index-chars 604 (while (not (eq (get-text-property pos 'kkc-conversion-index msg)
607 (- current-idx this-idx))) 605 current-idx))
608 msg) 606 (setq pos (next-single-property-change pos 'kkc-conversion-index
609 (aset msg (match-beginning 0) ?<) 607 msg limit)))
610 (aset msg (1- (match-end 0)) ?>))) 608 (put-text-property pos (next-single-property-change
611 (message "%s" msg))) 609 pos 'kkc-conversion-index msg limit)
610 'face 'highlight msg)))
611 (let ((message-log-max nil))
612 (message "%s" msg))))
612 613
613 ;; Update the conversion area with the latest conversion selected. 614 ;; Update the conversion area with the latest conversion selected.
614 ;; ALL if non nil means to update the whole area, else update only 615 ;; ALL if non nil means to update the whole area, else update only
615 ;; inside quail-overlay-head. 616 ;; inside quail-overlay-head.
616 617