aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2003-07-19 01:27:36 +0000
committerKenichi Handa2003-07-19 01:27:36 +0000
commitee6916fd02f378ed9842b408fe3f2baf0e7f3dd0 (patch)
treed2f82460ccf0608c6e1255317a1969f555f46080
parent81d171731e55c4b7a6c9b068e17a68a2677a0764 (diff)
downloademacs-ee6916fd02f378ed9842b408fe3f2baf0e7f3dd0.tar.gz
emacs-ee6916fd02f378ed9842b408fe3f2baf0e7f3dd0.zip
(kkc-show-conversion-list-update):
Highlight the correct candidate in the message.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/international/kkc.el39
2 files changed, 25 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b445cd733ea..7084e9f4f20 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12003-07-19 Kenichi Handa <handa@m17n.org>
2
3 * international/kkc.el (kkc-show-conversion-list-update):
4 Highlight the correct candidate in the message.
5
12003-07-18 John Paul Wallington <jpw@gnu.org> 62003-07-18 John Paul Wallington <jpw@gnu.org>
2 7
3 * simple.el (current-word): Don't include punctuation char when 8 * simple.el (current-word): Don't include punctuation char when
diff --git a/lisp/international/kkc.el b/lisp/international/kkc.el
index 2d9740207bd..a25cab5f4d1 100644
--- a/lisp/international/kkc.el
+++ b/lisp/international/kkc.el
@@ -549,13 +549,7 @@ and change the current conversion to the last one in the group."
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)))
@@ -587,7 +581,8 @@ and change the current conversion to the last one in the group."
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)
@@ -595,20 +590,26 @@ and change the current conversion to the last one in the group."
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