Source

skk / skk-server.el

Diff from to

skk-server.el

 ;;; skk-server.el --- SKK $B%5!<%P!<$N$?$a$N%W%m%0%i%`(B
-;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
+;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
+;;               1997, 1998, 1999
 ;; Masahiko Sato <masahiko@kuis.kyoto-u.ac.jp>
 
 ;; Author: Masahiko Sato <masahiko@kuis.kyoto-u.ac.jp>
 ;; Keywords: japanese
 ;; Last Modified: $Date$
 
-;; This program is free software; you can redistribute it and/or modify
+;; This file is part of SKK.
+
+;; SKK is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 ;; the Free Software Foundation; either versions 2, or (at your option)
 ;; any later version.
 
-;; This program is distributed in the hope that it will be useful
+;; SKK is distributed in the hope that it will be useful
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ;; GNU General Public License for more details.
 ;; MA 02111-1307, USA.
 
 ;;; Commentary:
-;; Following people contributed modifications to skk-server.el (Alphabetical
-;; order):
 ;;
-;;      Hitoshi SUZUKI <h-suzuki@ael.fujitsu.co.jp>
-;;      Hideki Sakurada <sakurada@kuis.kyoto-u.ac.jp>
-;;      Kenji Rikitake <kenji@reseau.toyonaka.osaka.jp>
-;;      Kiyotaka Sakai <ksakai@netwk.ntt-at.co.jp>
-;;      Mikio Nakajima <minakaji@osaka.email.ne.jp>
-;;      TOKUYA Junichi <tokuya@crab.fuji-ric.co.jp>
+;;; Code:
+(eval-when-compile (require 'skk))
+(require 'skk-foreword)
 
-;;; Change log:
-
-
-;;; Code:
-(require 'skk-foreword)
-(require 'skk-vars)
+;;;###autoload
+(defgroup skk-server nil "SKK server related customization."
+  :prefix "skk-server-"
+  :group 'skk )
 
 ;; user variables.
-;;;###skk-autoload
-(defvar skk-server-host (getenv "SKKSERVER")
-  "*SKK $B<-=q%5!<%P!<$rAv$i$;$F$$$k%[%9%HL>!#(B" )
+(defcustom skk-server-host (getenv "SKKSERVER")
+  "*SKK $B<-=q%5!<%P!<$rAv$i$;$F$$$k%[%9%HL>!#(B"
+  :type 'string
+  :group 'skk-server )
 
-;;;###skk-autoload
-(defvar skk-server-prog (getenv "SKKSERV")
-  "*SKK $B<-=q%5!<%P!<%W%m%0%i%`L>!#%U%k%Q%9$G=q$/!#(B" )
+(defcustom skk-server-prog (getenv "SKKSERV")
+  "*SKK $B<-=q%5!<%P!<%W%m%0%i%`L>!#%U%k%Q%9$G=q$/!#(B"
+  :type 'file
+  :group 'skk-server )
 
-(defvar skk-server-jisyo (getenv "SKK_JISYO")
-  "*SKK $B<-=q%5!<%P!<%W%m%0%i%`$KEO$9<-=qL>!#%U%k%Q%9$G=q$/!#(B" )
+(defcustom skk-server-jisyo (getenv "SKK_JISYO")
+  "*SKK $B<-=q%5!<%P!<%W%m%0%i%`$KEO$9<-=qL>!#%U%k%Q%9$G=q$/!#(B"
+  :type 'file
+  :group 'skk-server )
 
-(defvar skk-server-portnum nil
+(defcustom skk-server-portnum nil
   "*Non-nil $B$G$"$l$P!"$=$NCM$r(B port number $B$H$7$F(B skkserv $B$H(B TCP $B@\B3$9$k!#(B
-/etc/services $B$rD>@\=q$-49$($k8"8B$,$J$$%f!<%6!<$N$?$a$NJQ?t!#(B" )
+/etc/services $B$rD>@\=q$-49$($k8"8B$,$J$$%f!<%6!<$N$?$a$NJQ?t!#(B"
+  :type '(choice integer (const nil))
+  :group 'skk-server )
 
 ;;(defvar skk-server-debug nil
 ;;  "*Non-nil $B$G$"$l$P!"<-=q%5!<%P!<%W%m%0%i%`$r%G%#%P%C%0%b!<%I$G5/F0$9$k!#(B
 ;;$B%G%#%P%C%0!&%b!<%I$G(B skkserv $B$rAv$i$;$k$H!"$=$N$^$^(B foreground $B$GAv$j!"%a%C%;!<(B
 ;;$B%8$r=PNO$9$k!#%-!<%\!<%I$+$i3d$j$3$_$r$+$1$k$3$H$b$G$-$k!#(B" )
 
-;;;###skk-autoload
-(defvar skk-servers-list nil
+(defcustom skk-servers-list nil
   "*$B<-=q%5!<%P!<Kh$N>pJs%j%9%H!#(B
-$BJ#?t$N%^%7!<%s$GF0$$$F$$$k%5!<%P$K%"%/%;%9$G$-$k>l9g$K$O!"0J2<$N$h$&$K!"%j%9%H(B
-$B$N3FMWAG$K=g$K%[%9%HL>!"%U%k%Q%9$G$N(B SKK $B%5!<%P!<L>!"(BSKK $B%5!<%P!<$KEO$9<-=qL>!"(B
-SKK $B%5!<%P!<$,;HMQ$9$k%]!<%HHV9f$r=q$-!"@_Dj$r$9$k$3$H$b$G$-$k!#(B
 
-   (setq skk-servers-list
-         '((\"mars\" \"/usr/local/soft/nemacs/etc/skkserv\" nil nil)
-           (\"venus\" \"/usr/local/nemacs/etc/skkserv\" nil nil) ))
+$BJ#?t$N%[%9%H$GF0$$$F$$$k%5!<%P$K%"%/%;%9$G$-$k>l9g$K$O!"0J2<$N$h$&$K%j%9%H$N(B
+$B3FMWAG$K=g$K%[%9%HL>!"%U%k%Q%9$G$N(B SKK $B%5!<%P!<L>!"(BSKK $B%5!<%P!<$KEO$9<-=qL>!"(B
+SKK $B%5!<%P!<$,;HMQ$9$k%]!<%HHV9f$r=q$-!"@_Dj$r$9$k$3$H$,$G$-$k!#(B
 
-$B$3$N>l9g:G=i$K;XDj$7$?%5!<%P$K%"%/%;%9$G$-$J$/$J$k$H!"<+F0E*$K=g<!%j%9%H$K$"$k(B
-$B;D$j$N%5!<%P$K%"%/%;%9$9$k$h$&$K$J$k!#$J$*(B SKK $B%5!<%P!<$KEO$9<-=q$*$h$S(B SKK $B%5!<(B
-$B%P!<$,;HMQ$9$k%]!<%HHV9f$G!"(BSKK $B%5!<%P!<$r%3%s%Q%$%k;~$NCM$r;HMQ$9$k>l9g$O(B nil 
-$B$r;XDj$9$k!#(B" )
+   \(setq skk-servers-list
+         '\(\(\"host1\" \"/path/to/skkserv\" \"/path/to/SKK-JISYO.L\" 1178\)
+           \(\"host2\" \"/path/to/skkserv\"\) \)\)
 
-(defvar skk-report-server-response nil
-  "*Non-nil $B$G$"$l$P!"JQ49;~(B SKK $B%5!<%P!<$NAw=P$9$kJ8;z$r<u$1<h$k$^$G$K(B accept-process-output $B$r2?2s<B9T$7$?$+$rJs9p$9$k!#(B" )
+$B$3$N>l9g!":G=i$K;XDj$7$?%5!<%P$K%"%/%;%9$G$-$J$/$J$k$H!"<+F0E*$K=g<!%j%9%H$K$"(B
+$B$k;D$j$N%5!<%P$K%"%/%;%9$9$k$h$&$K$J$k!#(B
+$B%5!<%P!<$N%G%#%U%)%k%H$N<-=q$*$h$S%]!<%HHV9f$r;HMQ$9$k>l9g$O(B nil $B$r;XDj$9$k$+!"(B
+$B2?$b=q$+$J$$$GNI$$!#(B
 
-(defvar skk-remote-shell-program
+$B$J$*!"%f!<%6!<<+?H$K<B9T8"8B$N$J$$%5!<%P!<$r;XDj$9$k>l9g$O!"(B
+
+   \(setq skk-servers-list '\(\(\"host1\"\) \(\"host2\"\)\)\)
+
+$B$N$h$&$K!"%[%9%HL>$@$1$r=q$/$3$H$,$G$-$k!#>e5-$N@_DjNc$G$O!"(Bhost1, host2 $B$K$*(B
+$B$1$k(B skkserv $B%5!<%S%9$N(B TCP $B@\B3$N3+;O$N$_;n$_!"%5!<%P!<$N5/F0$O;n$_$J$$!#(B"
+  :type '(repeat
+	  (list (string :tag "Hostname")
+		(choice :tag "Server" file (const nil))
+		(choice :tag "Dictionary" file (const nil))
+		(choice :tag "Port number" integer (const nil)) ))
+  :group 'skk-server )
+
+(defcustom skk-server-report-response nil
+  "*Non-nil $B$G$"$l$P!"JQ49;~%5!<%P!<$NAw=P$9$kJ8;z$r<u$1<h$k$^$G$K(B accept-process-output $B$r2?2s<B9T$7$?$+$rJs9p$9$k!#(B"
+  :type 'boolean
+  :group 'skk-server )
+
+(defcustom skk-server-remote-shell-program
   (or (getenv "REMOTESHELL")
       (and (boundp 'remote-shell-program) remote-shell-program)
       (cond
        ((eq system-type 'EWS-UX/V) "/usr/ucb/remsh")
        ((eq system-type 'pcux) "/usr/bin/rcmd")
        (t "rsh") ))
-  "*$B%j%b!<%H%7%'%k$N%W%m%0%i%`L>!#(B" )
+  "*$B%j%b!<%H%7%'%k$N%W%m%0%i%`L>!#(B"
+  :type 'file
+  :group 'skk-server )
 
-(defvar skk-server-load-hook nil
-  "*skk-server.el $B$r%m!<%I$7$?8e$K%3!<%k$5$l$k%U%C%/!#(B" )
+(defcustom skk-server-load-hook nil
+  "*skk-server.el $B$r%m!<%I$7$?8e$K%3!<%k$5$l$k%U%C%/!#(B"
+  :type 'hook
+  :group 'skk-server )
 
-;; internal variable.
-(defvar skk-network-open-status 'open
-  "" )
+;; internal constants and variables.
+(defconst skk-network-open-status 'open)
+(defconst skkserv-working-buffer " *skkserv*")
+(defvar skkserv-process nil)
 
-;;;###skk-autoload
 (defun skk-server-version ()
   (interactive)
   (if (interactive-p)
           (skk-error "Lack of host information of SKK server"
                      "SKK $B%5!<%P!<$N%[%9%H>pJs$,$"$j$^$;$s(B" ))
       (setq status (process-status "skkservd"))
-      (if (not (eq status skk-network-open-status))
-          (setq status (skk-open-server)) )
+      (or (eq status skk-network-open-status) (setq status (skk-open-server)))
       (if (eq status skk-network-open-status)
           (let (v)
             (save-match-data
-              (with-current-buffer " *skkserv*"
+              (with-current-buffer skkserv-working-buffer
                 (erase-buffer)
                 ;; $B%5!<%P!<%P!<%8%g%s$rF@$k!#(B
                 (process-send-string "skkservd" "2")
                 ;; $B%[%9%HL>$rF@$k!#(B
                 (process-send-string "skkservd" "3")
                 (while (eq (buffer-size) 0)
-                  (accept-process-output) )                  
+                  (accept-process-output) )
                 (goto-char (point-min))
                 (format
                  (concat "SKK SERVER version %s"
   ;; skk-search-server $B$N%5%V%k!<%A%s!#(B
   (let ((key
 	 (if skk-use-numeric-conversion
-	     (skk-compute-numeric-henkan-key skk-henkan-key)
+	     (skk-num-compute-henkan-key skk-henkan-key)
 	   skk-henkan-key))
         ;; $B%P%C%U%!%m!<%+%kCM$N<u$1EO$7$N$?$a!"JLL>$N0l;~JQ?t$K<h$k!#(B
         (okurigana (or skk-henkan-okurigana skk-okuri-char))
         (status (process-status "skkservd")) )
-    (if (or (not status) (not (eq status skk-network-open-status)))
-        (setq status (skk-open-server)) )
+    (or (eq status skk-network-open-status) (setq status (skk-open-server)))
     (if (eq status skk-network-open-status)
-        (with-current-buffer " *skkserv*"
+        (with-current-buffer skkserv-working-buffer
           (let ((cont t) (count 0)
                 l )
             (erase-buffer)
               (accept-process-output)
               (setq count (1+ count))
               (if (> (buffer-size) 0)
-                  (if (eq  (char-after 1) ?1) ;?1
+                  (if (eq (char-after 1) ?1) ;?1
                       ;; found key successfully, so check if a whole line
                       ;; is received.
                       (if (eq (char-after (1- (point-max))) ?\n) ;?\n
                     ;; not found or error, so exit
                     (setq cont nil) )))
             (goto-char (point-min))
-            (if skk-report-server-response
+            (if skk-server-report-response
                 (skk-message "%d $B2s(B SKK $B%5!<%P!<$N1~EzBT$A$r$7$^$7$?(B"
                              "Waited for server response %d times" count ))
             (if (eq (following-char) ?1) ;?1
 
 (defun skk-open-server ()
   ;; SKK $B%5!<%P!<$H@\B3$9$k!#%5!<%P!<%W%m%;%9$N(B status $B$rJV$9!#(B
-  (let (status code)
+  (let (status code proc)
     (if (or (skk-open-network-stream) (skk-open-server-1))
         (progn
           (setq status (process-status "skkservd"))
           (if (eq status skk-network-open-status)
               (progn
-                (setq code (cdr (assoc "euc" skk-coding-system-alist)))
-		(if skk-xemacs
-		    (let ((proc (get-process "skkservd")))
-		      (set-process-input-coding-system proc code)
-		      (set-process-output-coding-system proc code))
-		  (if skk-mule
-		      (set-process-coding-system (get-process "skkservd")
-						 code code )))))))
+                (setq code (cdr (assoc "euc" skk-coding-system-alist))
+		      proc (get-process "skkservd") )
+		(cond ((eq skk-emacs-type 'xemacs)
+		       (set-process-input-coding-system proc code)
+		       (set-process-output-coding-system proc code) )
+		      (t
+		       (set-process-coding-system proc code code) ))))))
     status ))
 
 (defun skk-open-server-1 ()
   ;; skk-open-server $B$N%5%V%k!<%A%s!#(B
   ;; skkserv $B%5!<%S%9$r%*!<%W%s$G$-$?$i(B t $B$rJV$9!#(B
-  (let (status)
-    (if (null skk-servers-list)
-        (progn
-          ;; Emacs $B5/F08e$K4D6-JQ?t$r@_Dj$7$?>l9g!#(B
-          (if (not skk-server-host)
-              (setq skk-server-host (getenv "SKKSERVER")) )
-          (if (not skk-server-prog)
-              (setq skk-server-prog (getenv "SKKSERV")) )
-          (if (not skk-server-jisyo)
-              (setq skk-server-jisyo (getenv "SKK_JISYO")) )
-          (if (and skk-server-host skk-server-prog
-                   ;; skkserv $B$O0z?t$K<-=q$,;XDj$5$l$F$$$J$1$l$P!"(B
-                   ;; DEFAULT_JISYO $B$r;2>H$9$k!#(B
-                   ;;skk-server-jisyo
-                   )
-              (setq skk-servers-list (list (list skk-server-host
-                                                 skk-server-prog
-                                                 skk-server-jisyo
-                                                 skk-server-portnum )))
-            ;; reset SKK-SERVER-HOST so as not to use server in this session
-            (setq skk-server-host nil
-                  skk-server-prog nil ))))
-    (while (and (not (eq (process-status "skkservd") skk-network-open-status))
-                skk-servers-list )
-      (let ((elt (car skk-servers-list))
-            arg )
-        (setq skk-server-host (car elt)
-              skk-server-prog (nth 1 elt)
-              skk-server-jisyo (nth 2 elt)
-              skk-server-portnum (nth 3 elt)
-              skk-servers-list (cdr skk-servers-list) )
-        ;; skkserv $B$N5/F0%*%W%7%g%s$O2<5-$NDL$j!#(B
-        ;;     skkserv [-d] [-p NNNN] [JISHO]
-        ;;     `-d'     $B%G%#%P%C%0!&%b!<%I(B
-        ;;     `-p NNNN'     $BDL?.MQ$N%]!<%HHV9f$H$7$F(BNNNN$B$r;H$&(B.
-        ;;     `~/JISYO'     ~/JISYO$B$r<-=q$H$7$FMxMQ(B.
-        (if skk-server-jisyo
-            (setq arg (list skk-server-jisyo))
-          ;; skkserv $B$O0z?t$K<-=q$,;XDj$5$l$F$$$J$1$l$P!"(BDEFAULT_JISYO $B$r(B
-          ;; $B;2>H$9$k!#(B
-          )
-        ;;(if skk-server-debug
-        ;;    (setq arg (cons "-d" arg)) )
-	(if (and skk-server-portnum (not (eq skk-server-portnum 1178)))
-	    (setq arg
-		  (nconc (list "-p" (int-to-string skk-server-portnum)) arg)))
-        (or (skk-open-network-stream)
-            (skk-startup-server arg) )))
-    (if (not (eq (process-status "skkservd") skk-network-open-status))
-        ;; reset SKK-SERVER-HOST so as not to use server in this session
-        (setq skk-server-host nil
-              skk-server-prog nil
-              skk-servers-list nil )
-      t )))
+  ;; skkserv $B$O0z?t$K<-=q$,;XDj$5$l$F$$$J$1$l$P!"(BDEFAULT_JISYO $B$r;2>H$9$k!#(B
+  (if (null skk-servers-list)
+      (progn
+	;; Emacs $B5/F08e$K4D6-JQ?t$r@_Dj$7$?>l9g!#(B
+	(if (not skk-server-host)
+	    (setq skk-server-host (getenv "SKKSERVER")) )
+	(if (not skk-server-prog)
+	    (setq skk-server-prog (getenv "SKKSERV")) )
+	(if (not skk-server-jisyo)
+	    (setq skk-server-jisyo (getenv "SKK_JISYO")) )
+	(if skk-server-host
+	    (setq skk-servers-list (list (list skk-server-host
+					       skk-server-prog
+					       skk-server-jisyo
+					       skk-server-portnum )))
+	  (setq skk-server-prog nil) )))
+  (while (and (not (eq (process-status "skkservd") skk-network-open-status))
+	      skk-servers-list )
+    (let ((elt (car skk-servers-list))
+	  arg )
+      (setq skk-server-host (car elt)
+	    skk-server-prog (nth 1 elt)
+	    skk-server-jisyo (nth 2 elt)
+	    skk-server-portnum (nth 3 elt)
+	    skk-servers-list (cdr skk-servers-list) )
+      ;; skkserv $B$N5/F0%*%W%7%g%s$O2<5-$NDL$j!#(B
+      ;;     skkserv [-d] [-p NNNN] [JISHO]
+      ;;     `-d'     $B%G%#%P%C%0!&%b!<%I(B
+      ;;     `-p NNNN'     $BDL?.MQ$N%]!<%HHV9f$H$7$F(BNNNN$B$r;H$&(B.
+      ;;     `~/JISYO'     ~/JISYO$B$r<-=q$H$7$FMxMQ(B.
+      (if skk-server-jisyo
+	  (setq arg (list skk-server-jisyo))
+	;; skkserv $B$O0z?t$K<-=q$,;XDj$5$l$F$$$J$1$l$P!"(BDEFAULT_JISYO $B$r(B
+	;; $B;2>H$9$k!#(B
+	)
+      ;;(if skk-server-debug
+      ;;    (setq arg (cons "-d" arg)) )
+      (if (and skk-server-portnum (not (= skk-server-portnum 1178)))
+	  (setq arg
+		(nconc (list "-p" (number-to-string skk-server-portnum)) arg) ))
+      (if (and skk-server-host (not (skk-open-network-stream))
+	       skk-server-prog )
+	  ;; skk-startup-server $B$G%5!<%P!<$r5/F0$9$k$K$O!"(Bskk-server-host $B$H(B
+	  ;; skk-server-prog $B$,@_Dj$5$l$F$$$k$3$H$,I,MW!#(B
+	  (skk-startup-server arg) )))
+  (if (not (eq (process-status "skkservd") skk-network-open-status))
+      ;; reset SKK-SERVER-HOST so as not to use server in this session
+      (setq skk-server-host nil
+	    skk-server-prog nil
+	    skk-servers-list nil )
+    t ))
 
 (defun skk-open-network-stream ()
   ;; skk-server-host $B$K$*$1$k(B skkserv $B%5!<%S%9$N(B TCP $B@\B3$r%*!<%W%s$7!"%W%m%;(B
   ;; $B%9$rJV$9!#(B
-  ;; open-network-stream $B$GB8:_$7$J$$%P%C%U%!$,;XDj$5$l$?$i!"(Bget-buffer-create
-  ;; $B$7$F$/$F$k$N$G!"ITMW!#(B
-  ;;(get-buffer-create " *skkserv*")
   (condition-case nil
-      (open-network-stream
-       "skkservd" " *skkserv*" skk-server-host (or skk-server-portnum "skkserv"))
+      (progn
+	(setq skkserv-process
+	      (open-network-stream "skkservd" skkserv-working-buffer
+				   skk-server-host
+				   (or skk-server-portnum "skkserv") ))
+	(process-kill-without-query skkserv-process) )
     (error nil) ))
 
 (defun skk-startup-server (arg)
   ;; skkserv $B$r5/F0$G$-$?$i(B t $B$rJV$9!#(B
   (let (
         ;;(msgbuff (get-buffer-create " *skkserv-msg*"))
-        (count 7) status )
+        (count 7) )
     (while (> count 0)
       (skk-message
        "%s $B$N(B SKK $B%5!<%P!<$,5/F0$7$F$$$^$;$s!#5/F0$7$^$9(B%s"
                  ;;msgbuff
                  0 nil arg)
         (apply 'call-process
-               skk-remote-shell-program nil
+               skk-server-remote-shell-program nil
                ;; 0 $B$K$7$F%5%V%W%m%;%9$N=*N;$rBT$C$F$O$$$1$J$$M}M3$,$"$k!)(B
                ;; $B$J$1$l$P(B msgbuf $B$K%(%i!<=PNO$r<h$C$?J}$,7z@_E*$G$O!)(B  $B$^$?$=(B
                ;; $B$N>l9g$O$3$N(B while $B%k!<%W<+?H$,$$$i$J$$!)(B
       (ding) ;return nil
       nil ))) ; $B$G$bG0$N$?$a(B
 
-;;;###skk-autoload
+;;;###autoload
 (defun skk-adjust-search-prog-list-for-server-search (&optional non-del)
   ;; skk-server-host $B$b$7$/$O(B skk-servers-list $B$,(B nil $B$G$"$l$P!"(B
   ;; skk-search-prog-list $B$+$i(B skk-search-server $B$r(B car $B$K;}$D%j%9%H$r>C$9!#(B
   (if (or skk-server-host skk-servers-list)
       (if (null (assq 'skk-search-server skk-search-prog-list))
           ;; skk-search-prog-list $B$,(B nil $B$H$$$&$3$H$O$^$:$J$$$@$m$&$,!"G0$N$?(B
-          ;; $B$a!"(Bsetq $B$7$F$*$/!#(B          
+          ;; $B$a!"(Bsetq $B$7$F$*$/!#(B
           (setq skk-search-prog-list
                 ;; $BKvHx$KIU$1$k!#KvHx$K$O(B (skk-okuri-search) $B$r;}$C$F$-$?$$?M(B
                 ;; $B$b$$$k$+$b!#%*%W%7%g%s$GIU$1$k>l=j$rJQ99$9$k$h$&$K$7$?J}$,(B
                        (list
                         '(skk-search-server skk-aux-large-jisyo 10000) ))))
     (if (not non-del)
-        ;; skk-search-prog-list $B$N@hF,$,(B skk-search-server $B$+$i;O$^$k%j%9%H$@(B
-        ;; $B$H$$$&$3$H$O$^$:$J$$$@$m$&$,!"G0$N$?$a!"(Bsetq $B$7$F$*$/!#(B
-        (setq skk-search-prog-list
-              (delq (assq 'skk-search-server skk-search-prog-list)
-                    skk-search-prog-list )))))
+	(remove-alist 'skk-search-prog-list 'skk-search-server) )))
 
 (defun skk-disconnect-server ()
   ;; $B%5!<%P!<$r@Z$jN%$9!#(B