From: ueno Date: Sun, 6 Jun 2004 06:11:59 +0000 (+0000) Subject: * riece-rdcc.el (riece-command-dcc-send): Replace whitespace with X-Git-Tag: riece-1_0_1~20 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=4114d6ef900eeda4b7ccd685acf5040d2d57d7e5;p=elisp%2Friece.git * riece-rdcc.el (riece-command-dcc-send): Replace whitespace with "_". (riece-command-dcc-receive): Convert default filename with convert-standard-filename. (riece-handle-dcc-request): Handle filenames enclosed with "...". --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 37df294..3d8681f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2004-06-06 Daiki Ueno + + * riece-rdcc.el (riece-command-dcc-send): Replace whitespace with + "_". + (riece-command-dcc-receive): Convert default filename with + convert-standard-filename. + (riece-handle-dcc-request): Handle filenames enclosed with "...". + 2004-06-04 TAKAHASHI Kaoru * riece-hangman.el (riece-hangman-word): Check killed-buffer or diff --git a/lisp/riece-rdcc.el b/lisp/riece-rdcc.el index 530f40e..21fab6f 100644 --- a/lisp/riece-rdcc.el +++ b/lisp/riece-rdcc.el @@ -172,7 +172,10 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{" (accept-process-output process)) (if (eq (process-status process) 'run) (let ((address (match-string 1)) - (port (match-string 2))) + (port (match-string 2)) + (filename (file-name-nondirectory file))) + (while (string-match "[ \t]+" filename) + (setq filename (replace-match "_" nil nil filename))) (erase-buffer) (make-local-variable 'riece-rdcc-request-size) (setq riece-rdcc-request-file file @@ -183,7 +186,7 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{" (riece-send-string (format "PRIVMSG %s :\1DCC SEND %s %s %s %d\1\r\n" (riece-identity-prefix user) - (file-name-nondirectory file) + filename address port riece-rdcc-request-size))))))) @@ -258,8 +261,9 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{" (error "Invalid number")) (nth (1- number) riece-rdcc-requests)))) (default-name (expand-file-name - (nth 1 request) (or riece-rdcc-save-directory - default-directory)))) + (convert-standard-filename (nth 1 request)) + (or riece-rdcc-save-directory + default-directory)))) (list request (expand-file-name (read-file-name @@ -322,12 +326,13 @@ puts(\"#{" address " >> 24 & 0xFF}.#{" address " >> 16 & 0xFF}.#{" (let ((case-fold-search t)) (when (and riece-rdcc-enabled (string-match - "SEND \\([^ ]+\\) \\([^ ]+\\) \\([^ ]+\\) \\([^ ]+\\)" + "SEND \\(\\([^ ]+\\)\\|\"\\(.+\\)\"\\) \\([^ ]+\\) \\([^ ]+\\) \\([^ ]+\\)" message)) - (let ((file (match-string 1 message)) - (address (match-string 2 message)) - (port (string-to-number (match-string 3 message))) - (size (string-to-number (match-string 4 message))) + (let ((file (or (match-string 2 message) + (match-string 3 message))) + (address (match-string 4 message)) + (port (string-to-number (match-string 5 message))) + (size (string-to-number (match-string 6 message))) (buffer (if (riece-channel-p target) (riece-channel-buffer (riece-make-identity target riece-server-name))))