* riece-commands.el (riece-command-enter-message): Fix behavior at last line of buffer.
authorTAKAHASHI Kaoru <kaoru@kaisei.org>
Mon, 25 Aug 2008 06:57:01 +0000 (06:57 +0000)
committerTAKAHASHI Kaoru <kaoru@kaisei.org>
Mon, 25 Aug 2008 06:57:01 +0000 (06:57 +0000)
(riece-command-enter-message-to-user): Ditto.
(riece-command-enter-message-as-notice): Ditto.

lisp/ChangeLog
lisp/riece-commands.el

index 617d755..c683f50 100644 (file)
@@ -1,3 +1,10 @@
+2008-08-25  TAKAHASHI Kaoru  <kaoru@kaisei.org>
+
+       * riece-commands.el (riece-command-enter-message): Fix behavior at
+       last line of buffer.
+       (riece-command-enter-message-to-user): Ditto.
+       (riece-command-enter-message-as-notice): Ditto.
+
 2008-06-11  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-options.el (riece-use-full-window): Abolish unused option.
index ddb353d..1f47339 100644 (file)
@@ -443,8 +443,10 @@ the layout to the selected layout-name."
                               (riece-line-beginning-position)
                               (riece-line-end-position))
                              nil)
-  (if (> (forward-line) 0)
-      (insert "\n")))
+  (forward-line 1)
+  (when (eobp)
+    (insert "\n")))
+
 
 (defun riece-command-enter-message-as-notice ()
   "Send the current line to the current channel as NOTICE."
@@ -453,8 +455,9 @@ the layout to the selected layout-name."
                               (riece-line-beginning-position)
                               (riece-line-end-position))
                              t)
-  (if (> (forward-line) 0)
-      (insert "\n")))
+  (forward-line 1)
+  (when (eobp)
+    (insert "\n")))
 
 (defun riece-command-enter-message-to-user (user)
   "Send the current line to USER."
@@ -474,8 +477,9 @@ the layout to the selected layout-name."
      user)
     (riece-display-message
      (riece-make-message (riece-current-nickname) user text nil t)))
-  (if (> (forward-line) 0)
-      (insert "\n")))
+  (forward-line 1)
+  (when (eobp)
+    (insert "\n")))
 
 (defun riece-command-join-channel (target key)
   (unless (riece-server-opened (riece-identity-server target))