From: ueno Date: Sun, 27 Jan 2002 16:47:09 +0000 (+0000) Subject: * liece-dcc.el (liece-dcc-start-process): New function. X-Git-Tag: liece-2_0_0-pre1~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=1a6e9b9d403c9d91826569bcebbb2b73e4d6a12f;p=elisp%2Fliece.git * liece-dcc.el (liece-dcc-start-process): New function. (liece-command-dcc-send): Use it. (liece-command-dcc-receive): Use it. (liece-command-dcc-chat-listen): Use it. (liece-command-dcc-chat-connect): Use it. --- diff --git a/lisp/liece-dcc.el b/lisp/liece-dcc.el index 4963610..ff384ba 100644 --- a/lisp/liece-dcc.el +++ b/lisp/liece-dcc.el @@ -48,6 +48,12 @@ (defstruct liece-dcc-object type from host port file size) +(defun liece-dcc-start-process (args) + (let ((program + (or (car-safe liece-dcc-program) + liece-dcc-program))) + (apply #'start-process " *DCC*" nil program args))) + (defun liece-dcc-enqueue-request (type &rest args) (let ((request (apply #'make-liece-dcc-object :type type args))) (inline (queue-enqueue liece-dcc-requests request)))) @@ -109,10 +115,9 @@ nil nil nil nil liece-privmsg-partner))) (setq liece-privmsg-partner towhom) - (let (process) - (setq process (start-process - liece-dcc-program nil liece-dcc-program - "send" (int-to-string liece-dcc-port) filename)) + (let ((process + (liece-dcc-start-process + (list "send" (int-to-string liece-dcc-port) filename)))) (set-process-filter process #'liece-dcc-send-filter) (set-process-sentinel process #'liece-dcc-sentinel)) (or (zerop liece-dcc-port) @@ -188,17 +193,15 @@ (expand-file-name (liece-dcc-object-file object) liece-dcc-directory)) - process) - (setq process - (start-process - liece-dcc-program nil liece-dcc-program - "receive" - (liece-dcc-object-host object) - (liece-dcc-object-port object) - (liece-dcc-object-size object) - (expand-file-name - (liece-dcc-object-file object) - liece-dcc-directory))) + (process + (liece-dcc-start-process + (list "receive" + (liece-dcc-object-host object) + (liece-dcc-object-port object) + (liece-dcc-object-size object) + (expand-file-name + (liece-dcc-object-file object) + liece-dcc-directory))))) (set-process-filter process #'liece-dcc-receive-filter) (set-process-sentinel process #'liece-dcc-sentinel) (liece-dcc-add-to-process-alist @@ -219,18 +222,15 @@ (append liece-nick-alist liece-channel-alist) nil nil nil nil liece-privmsg-partner))) (setq liece-privmsg-partner towhom) - (let (process) - (as-binary-process - (setq process - (start-process - liece-dcc-program nil - liece-dcc-program "chat" "listen" - (int-to-string liece-dcc-port))) - (set-process-buffer - process - (liece-get-buffer-create (format " DCC:%s" (process-id process)))) - (set-process-filter process 'liece-dcc-chat-listen-filter) - (set-process-sentinel process 'liece-dcc-sentinel))) + (let ((process + (as-binary-process + (liece-dcc-start-process + (list "chat" "listen" (int-to-string liece-dcc-port)))))) + (set-process-buffer + process + (liece-get-buffer-create (format " DCC:%s" (process-id process)))) + (set-process-filter process 'liece-dcc-chat-listen-filter) + (set-process-sentinel process 'liece-dcc-sentinel)) (unless (zerop liece-dcc-port) (setq liece-dcc-port (1+ liece-dcc-port)))) @@ -268,20 +268,20 @@ (liece-message (_ "DCC No chat request has been arrived.")) (liece-dcc-message (_ "Connecting to: %s") nick) (setq liece-privmsg-partner nick) - (as-binary-process - (setq process - (start-process liece-dcc-program nil - liece-dcc-program "chat" "connect" - (liece-dcc-object-host object) - (liece-dcc-object-port object))) - (set-process-buffer - process - (liece-get-buffer-create - (format " DCC:%s" (process-id process)))) - (set-process-filter process #'liece-dcc-chat-connect-filter) - (set-process-sentinel process #'liece-dcc-sentinel) - (liece-dcc-add-to-process-alist - process 'chat :from liece-privmsg-partner))))) + (setq process + (as-binary-process + (liece-dcc-start-process + (list "chat" "connect" + (liece-dcc-object-host object) + (liece-dcc-object-port object))))) + (set-process-buffer + process + (liece-get-buffer-create + (format " DCC:%s" (process-id process)))) + (set-process-filter process #'liece-dcc-chat-connect-filter) + (set-process-sentinel process #'liece-dcc-sentinel) + (liece-dcc-add-to-process-alist + process 'chat :from liece-privmsg-partner)))) (defun liece-dcc-chat-connect-filter (process output) (if (string-match "^DCC chat established" output)