changeset 65:dfa3a81d3cde

*** empty log message ***
author gongo
date Fri, 29 Aug 2008 23:28:24 +0900
parents 312ea950243c
children d3088b01c363
files ChangeLog redit-client-sm.el
diffstat 2 files changed, 52 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 29 17:06:35 2008 +0900
+++ b/ChangeLog	Fri Aug 29 23:28:24 2008 +0900
@@ -1,5 +1,29 @@
 2008-08-29  Wataru MIYAGUNI  <gongo@cr.ie.u-ryukyu.ac.jp>
 
+	* test: SessionManager GUI 版
+	cvs の member/gongo/JavaSessionManagerCUI/export に置いてます。
+	sm-cui.jar ってやつで、実行は sm-cui.sh で行けます。
+	ちなみにGUI版は sessionmanager.jar で、sm.sh で実行できる。
+
+	GUI版と違い、CUI版ではマウスでセッション選んで〜ってのができないので、
+	暫定的に redit-select-command を実装しました。
+
+	M-x redit-select-command
+	で、下の minibuffer に "Session ID: " とかでるので
+	先に put した時に出てきた Session ID を指定すると
+	入れるので、あとはいつもと同じ感じです。
+
+	send command byUTF8: 46,1,2,0,0,6,test.c
+	UTF-8: Set REPComand textlen(Byte) : 6
+
+	コマンドが 46 になってるやつの、左から2番目が session id です。
+	ここでは 1 になります。
+	「Session ID はこれです!」って強調した文字出力してねーや。。。
+	
+	GUI/CUI ともに、なぜか textsize が 0 のコマンドは
+	送っても何も送らない不思議。なんか見逃してるかもしれない。
+	emacs 側か sm 側かはしらないけど、要チェック。
+
 	* redit-client-sm.el: delete
 	redit-client-session-id
 	redit-client-editor-id
--- a/redit-client-sm.el	Fri Aug 29 17:06:35 2008 +0900
+++ b/redit-client-sm.el	Fri Aug 29 23:28:24 2008 +0900
@@ -343,6 +343,31 @@
 	)
       )))
 
+(defun redit-select-command ()
+  "Allow this Emacs process to be a remote-edit session manager for client processes."
+  (interactive)
+  (let (sid)
+    (if (null redit-client-process)
+	(progn
+	  (setq redit-client-process (open-network-stream
+				      "redit-client" nil redit-process-hostname
+				      redit-process-port))
+
+	  (set-process-sentinel redit-client-process 'redit-client-sentinel)
+	  (set-process-filter redit-client-process 'redit-client-process-filter)
+	  (set-process-coding-system redit-client-process 'binary 'binary)
+	  (set-process-query-on-exit-flag redit-client-process nil)
+	  ))
+
+    (setq sid (read-minibuffer "Input session id: "))
+    (process-send-string redit-client-process
+			 (redit-make-packet
+			  redit-select-command sid 0 0 0 0 ""))
+
+    (redit-debug-message
+     (format "select-command: %d %d 0 0 0 0 0" redit-select-command sid))
+  ))
+
 (defun redit-quit-command ()
   "quit"
   (interactive)
@@ -442,15 +467,14 @@
 		;; insert lines on server buffer
 		(setq packet (redit-make-packet
 			      redit-delete-line-command sid eid
-			      (gen-seqno) linenum
-			      5 "55555"))
+			      (gen-seqno) linenum 5 "55555"))
 	    
 		(process-send-string redit-client-process packet)
 
 		(redit-debug-message
 		 (format "delete-line-command: %d %d %d %d %d %d %s"
 			 redit-delete-line-command sid eid (gen-seqno)
-			 linenum 5 "55555"))
+			 linenum 0 ""))
 		))
 	  ))
     (error "redit-client is not running.")))
@@ -490,7 +514,7 @@
 	(setq txt (redit-get-text-from-pkt string))
 	
 	;; command がどの命令かを判断し、対応した処理をする。case みたい
-	(cond 	   
+	(cond
 	 ((if (= cmd redit-insert-command)
 	      (redit-client-exec-insert-line sid lno txt)))