549 |
;; The currently selected conversion is after the list shown |
;; The currently selected conversion is after the list shown |
550 |
;; previously. We start calculation of message width from |
;; previously. We start calculation of message width from |
551 |
;; the conversion next of TO. |
;; the conversion next of TO. |
552 |
(setq this-idx next-idx msg nil) |
(setq this-idx next-idx msg nil))) |
|
;; The current conversion is in MSG. Just clear brackets |
|
|
;; around index number. |
|
|
(if (string-match "<.>" msg) |
|
|
(progn |
|
|
(aset msg (match-beginning 0) ?\ ) |
|
|
(aset msg (1- (match-end 0)) ?\ ))))) |
|
553 |
(if (not msg) |
(if (not msg) |
554 |
(let ((len (length kkc-current-conversions)) |
(let ((len (length kkc-current-conversions)) |
555 |
(max-width (window-width (minibuffer-window))) |
(max-width (window-width (minibuffer-window))) |
581 |
(setq l (nthcdr this-idx kkc-current-conversions)) |
(setq l (nthcdr this-idx kkc-current-conversions)) |
582 |
(setq msg (format " %c %s" |
(setq msg (format " %c %s" |
583 |
(aref kkc-show-conversion-list-index-chars 0) |
(aref kkc-show-conversion-list-index-chars 0) |
584 |
(car l)) |
(propertize (car l) |
585 |
|
'kkc-conversion-index this-idx)) |
586 |
idx (1+ this-idx) |
idx (1+ this-idx) |
587 |
l (cdr l)) |
l (cdr l)) |
588 |
(while (< idx next-idx) |
(while (< idx next-idx) |
590 |
msg |
msg |
591 |
(aref kkc-show-conversion-list-index-chars |
(aref kkc-show-conversion-list-index-chars |
592 |
(- idx this-idx)) |
(- idx this-idx)) |
593 |
(car l))) |
(propertize (car l) |
594 |
(setq idx (1+ idx) |
'kkc-conversion-index idx)) |
595 |
|
idx (1+ idx) |
596 |
l (cdr l))) |
l (cdr l))) |
597 |
(aset first-slot 2 msg))) |
(aset first-slot 2 msg))) |
598 |
|
|
599 |
|
;; Highlight the current conversion. |
600 |
(if (> current-idx 0) |
(if (> current-idx 0) |
601 |
(progn |
(let ((pos 3) |
602 |
;; Highlight the current conversion by brackets. |
(limit (length msg))) |
603 |
(string-match (format " \\(%c\\) " |
(remove-text-properties 0 (length msg) '(face nil) msg) |
604 |
(aref kkc-show-conversion-list-index-chars |
(while (not (eq (get-text-property pos 'kkc-conversion-index msg) |
605 |
(- current-idx this-idx))) |
current-idx)) |
606 |
msg) |
(setq pos (next-single-property-change pos 'kkc-conversion-index |
607 |
(aset msg (match-beginning 0) ?<) |
msg limit))) |
608 |
(aset msg (1- (match-end 0)) ?>))) |
(put-text-property pos (next-single-property-change |
609 |
(message "%s" msg))) |
pos 'kkc-conversion-index msg limit) |
610 |
|
'face 'highlight msg))) |
611 |
|
(let ((message-log-max nil)) |
612 |
|
(message "%s" msg)))) |
613 |
|
|
614 |
;; Update the conversion area with the latest conversion selected. |
;; Update the conversion area with the latest conversion selected. |
615 |
;; ALL if non nil means to update the whole area, else update only |
;; ALL if non nil means to update the whole area, else update only |