[Prime-cvs] CVS update: prime-el/src

Back to archive index

Hiroyuki Komatsu komat****@users*****
2005年 2月 16日 (水) 08:09:52 JST


Index: prime-el/src/prime.el
diff -u prime-el/src/prime.el:1.6 prime-el/src/prime.el:1.7
--- prime-el/src/prime.el:1.6	Tue Dec  7 21:29:04 2004
+++ prime-el/src/prime.el	Wed Feb 16 08:09:51 2005
@@ -1,5 +1,5 @@
 ;;;; prime.el: Emacs Lisp for PRIME
-;;;; $Id: prime.el,v 1.6 2004/12/07 12:29:04 komatsu Exp $
+;;;; $Id: prime.el,v 1.7 2005/02/15 23:09:51 komatsu Exp $
 ;;;;
 ;;;; Copyright (C) 2002, 2003 Hiroyuki Komatsu <komat****@taiya*****>
 ;;;;     All rights reserved.
@@ -161,9 +161,11 @@
 (defun prime-convert-region (beg end)
   (interactive "r")
   (let ((pattern (japanese-hiragana (buffer-substring beg end))))
-    (if nil   ;; (string-match "\\cj" pattern)
-	(message (concat "再変換に対応していない文字列が含まれています. "
-			 "(" pattern ")"))
+;;     (if nil   ;; (string-match "\\cj" pattern)
+;; 	(message (concat "再変換に対応していない文字列が含まれています. "
+;; 			 "(" pattern ")"))
+    (if (string-match "\n" pattern)
+	(message "再変換には改行を含めないでください。")
       (setq prime-start-pat (buffer-substring beg end))
       (prime-input-mode-on t)
       (delete-region beg end)
Index: prime-el/src/prime-style.el
diff -u prime-el/src/prime-style.el:1.8 prime-el/src/prime-style.el:1.9
--- prime-el/src/prime-style.el:1.8	Tue Mar 30 14:44:30 2004
+++ prime-el/src/prime-style.el	Wed Feb 16 08:09:51 2005
@@ -1,4 +1,4 @@
-;; $Id: prime-style.el,v 1.8 2004/03/30 05:44:30 komatsu Exp $
+;; $Id: prime-style.el,v 1.9 2005/02/15 23:09:51 komatsu Exp $
 
 (defcustom prime-style nil "PRIME $B$NF~NO%9%?%$%k(B
 'default, 'kana, 'tcode, 'capital-only, 'komatsu $B$+$iA*Br2DG=(B.
@@ -29,9 +29,9 @@
 lookup-el, ebview $B$^$?$O(B nil $B$,;XDj2DG=$G$9!#(B")
 
 (defcustom prime-style-display-candidates 'compact
-  "$BC18l8uJd$NI=<(J}K!(B (compact or all / default is compact)")
+  "$BC18l8uJd$NI=<(J}K!(B (compact, fixed or all / default is compact)")
 (defcustom prime-style-display-candidates-compact 'default
-  "prime-style-display-candidates $B$,(B compact $B$N>l9g$N!":Y$+$$I=<(J}K!(B
+  "prime-style-display-candidates $B$,(B compact $B$^$?$O(B fixed $B$N>l9g$N!":Y$+$$I=<(J}K!(B
 {default, always-number-selection}")
 
 
Index: prime-el/src/prime-main.el
diff -u prime-el/src/prime-main.el:1.15 prime-el/src/prime-main.el:1.16
--- prime-el/src/prime-main.el:1.15	Fri Dec 10 21:20:39 2004
+++ prime-el/src/prime-main.el	Wed Feb 16 08:09:51 2005
@@ -358,7 +358,8 @@
       (mell-marker-set 'prime-cand-list-begin (point))
       (prime-disp-cand-list-one)
       )
-     ((or prime-cand-mode); prime-conv-mode)
+     ((or prime-cand-mode
+	  (and prime-conv-mode (eq prime-style-display-candidates 'all)))
       (end-of-line)
       ;; marker $B$H$N7s$M9g$$$G$A$g$C$HD>46E*$G$J$$$3$H$K$J$C$F$$$k(B.
       (insert "\n")
@@ -366,7 +367,7 @@
       ;;
       (prime-disp-cand-list-all)
       )
-     (t
+     (t ;; prime-conv-mode is here.
       (let (col)
 	(goto-char prime-curstr-begin)
 	(setq col (+ (% (current-column) (window-width))
@@ -377,7 +378,9 @@
 	(mell-marker-set 'prime-cand-list-begin (point))
 	;;
 	(insert (make-string col 32)) ; 32 = space
-	(prime-disp-cand-list-one)
+	(if (eq prime-style-display-candidates 'fixed)
+	    (prime-disp-cand-list-fixed)
+	  (prime-disp-cand-list-compact))
 	)))
     ;; marker $B$H$N7s$M9g$$$G$A$g$C$HD>46E*$G$J$$$3$H$K$J$C$F$$$k(B.
     (mell-marker-set 'prime-cand-list-end (point))
@@ -395,7 +398,7 @@
 ;      (setq i (1+ i))
 ;      )))
 
-(defun prime-disp-cand-list-one ()
+(defun prime-disp-cand-list-compact ()
   (let ((i 0)
 	(offset (+ prime-nth-cand (if prime-conv-mode 1 0))))
     (while (and (< i 10) ;(if prime-conv-mode 10 3))
@@ -410,6 +413,42 @@
       )
     ))
 
+(defun prime-disp-insert-highlighted (string)
+  (let (beginning end)
+    (setq beginning (point))
+    (insert string)
+    (setq end (point))
+    (font-lock-prepend-text-property
+     beginning end 'face 'prime-cand-cursor-face)
+;;; $B$3$l$O(B XEmacs only
+;;;	    (font-lock-set-face beginning end 'prime-cand-cursor-face)
+    ))
+
+(defun prime-disp-cand-list-fixed ()
+  (let ((i 0))
+    (while (and (< i (length prime-cands))
+		(< i 10))
+      (cond
+       ((and prime-enum-mode  ;; prime-enum-mode
+	     (or prime-conv-mode (not prime-enum-mode-ignorep))
+	     (< i (length prime-enum-char-list)))
+	(let ((string (concat (char-to-string (nth i prime-enum-char-list))
+			      (prime-nth-candidate i)
+			      " ")))
+	  (if (and prime-conv-mode
+		   (= i prime-nth-cand))
+	      (prime-disp-insert-highlighted string)
+	    (insert string))))
+       (t ;; under the normal mode
+	;; FIXME: Remove this checking routine using prime-conv-mode.
+	;; FIXME: (2005-02-16) <Hiroyuki Komatsu>
+	(if (and prime-conv-mode
+		 (= i prime-nth-cand))
+	    (prime-disp-insert-highlighted
+	     (concat "[" (prime-nth-candidate i) "]"))
+	  (insert "(" (prime-nth-candidate i) ")"))))
+      (setq i (1+ i)))))
+
 
 (defun prime-disp-cand-list-all ()
   (let ((i 0))
@@ -418,15 +457,8 @@
 	      (window-width))
 	   (insert "\n"))
       (if (= i prime-nth-cand)
-	  (let (beginning end)
-	    (setq beginning (point))
-	    (insert "[" (prime-nth-candidate i) "]")
-	    (setq end (point))
-	    (font-lock-prepend-text-property
-	     beginning end 'face 'prime-cand-cursor-face)
-; $B$3$l$O(B XEmacs only
-;	    (font-lock-set-face beginning end 'prime-cand-cursor-face)
-	    )
+	  (prime-disp-insert-highlighted
+	   (concat "[" (prime-nth-candidate i) "]"))
 	(insert "(" (prime-nth-candidate i) ")"))
       (setq i (1+ i))
       )))
Index: prime-el/src/prime-enum-mode.el
diff -u prime-el/src/prime-enum-mode.el:1.3 prime-el/src/prime-enum-mode.el:1.4
--- prime-el/src/prime-enum-mode.el:1.3	Wed Mar 31 06:20:28 2004
+++ prime-el/src/prime-enum-mode.el	Wed Feb 16 08:09:51 2005
@@ -1,5 +1,5 @@
 ;;;; prime-enum-mode.el: Description about selection by typing of numbers.
-;;;; $Id: prime-enum-mode.el,v 1.3 2004/03/30 21:20:28 komatsu Exp $
+;;;; $Id: prime-enum-mode.el,v 1.4 2005/02/15 23:09:51 komatsu Exp $
 ;;;;
 ;;;; Copyright (C) 2003 Hiroyuki Komatsu <komat****@taiya*****>
 ;;;;     All rights reserved.
@@ -65,8 +65,10 @@
        (t
 	(prime-fix
 	 (prime-nth-candidate
-	  (+ prime-nth-cand
-	     (if prime-conv-mode 1 0);; $B$3$3(B, $B$h$/$J$$$M(B.
+	  (+ (if (eq prime-style-display-candidates 'compact)
+		 (+ prime-nth-cand
+		    (if prime-conv-mode 1 0)) ;; $B$3$3(B, $B$h$/$J$$$M(B.
+	       0)
 	     (mell-list-member-get-nth char prime-enum-char-list))))
 	(prime-after-fix)
 	t)


Prime-cvs メーリングリストの案内
Back to archive index