* riece-filter.el (riece-filter): Simplified.
authorDaiki Ueno <ueno@unixuser.org>
Mon, 7 Feb 2005 04:48:01 +0000 (04:48 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Mon, 7 Feb 2005 04:48:01 +0000 (04:48 +0000)
lisp/ChangeLog
lisp/riece-filter.el

index ed78350..5cfe9f4 100644 (file)
@@ -1,5 +1,7 @@
 2005-02-07  Daiki Ueno  <ueno@unixuser.org>
 
+       * riece-filter.el (riece-filter): Simplified.
+
        * riece-addon.el (riece-resolve-addons): Check the existence of
        riece-addon-directory.
 
index 9182404..39edd49 100644 (file)
 (defun riece-filter (process input)
   (save-excursion
     (set-buffer (process-buffer process))
-    (goto-char riece-read-point)
-    (unless riece-debug
-      (delete-region (riece-line-beginning-position) (point-min))
-      (setq riece-read-point (point)))
+    (goto-char (point-max))
     (insert input)
-    (goto-char (prog1 riece-read-point
-                (setq riece-read-point (point))))
+    (goto-char riece-read-point)
     (beginning-of-line)
     (while (and (not (eobp))
                (looking-at ".*\n"))    ;the input line is not finished
       (save-excursion
        (if (looking-at
-            ":\\([^ ]+\\) +\\([0-5][0-9][0-9]\\) +\\([^ ]+\\) +\\(.*\\)\n")
+            ":\\([^ ]+\\) +\\([0-5][0-9][0-9]\\) +\\([^ ]+\\) +\\(.*\\)")
            (riece-handle-numeric-reply
             (match-string 1)           ;prefix
             (string-to-number (match-string 2)) ;number
             (match-string 3)           ;name
             (riece-chomp-string (match-string 4))) ;reply string
-         (if (looking-at "\\(:\\([^ ]+\\) +\\)?\\([^ ]+\\) +\\(.*\\)\n")
+         (if (looking-at "\\(:\\([^ ]+\\) +\\)?\\([^ ]+\\) +\\(.*\\)")
              (riece-handle-message
               (match-string 2)         ;optional prefix
               (match-string 3)         ;command
                         (buffer-substring (point) (progn
                                                     (end-of-line)
                                                     (point))))))))
-      (forward-line))))
+      (forward-line))
+    (unless riece-debug
+      (delete-region (point-min) (point)))
+    (setq riece-read-point (point))))
 
 (eval-when-compile
   (autoload 'riece-exit "riece"))