erc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Erc-commit] [commit][emacs22] Fix a couple of bugs.


From: mwolson
Subject: [Erc-commit] [commit][emacs22] Fix a couple of bugs.
Date: Sun, 14 Oct 2007 00:48:24 -0400

commit 662591eb7ab0ce71cb6ab10d6d4e6f522c3c0e6e
Author: Michael Olson <address@hidden>
Date:   Mon Aug 7 06:35:33 2006 +0000

    Fix a couple of bugs.
    
    * erc-backend.el (erc-process-sentinel-1): Use erc-display-message in
      several places instead of inserting text.
      (erc-process-sentinel): Move to the input-marker before removing the
      prompt.
    
    * erc.el (erc-port): Fix customization options.
      (erc-display-message): Handle null type explicitly.  Previously, this
      was relying on a chance side-effect.  Cosmetic indentation tweak.
      (english): Add 'finished and 'terminated entries to the catalog.  Add
      initial and terminal newlines to 'disconnected and
      'disconnected-noreconnect entries.  Avoid long lines.
    git-archimport-id: address@hidden/erc--main--0--patch-37

diff --git a/ChangeLog b/ChangeLog
index c977823..35e0777 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2006-08-07  Michael Olson  <address@hidden>
+
+       * erc-backend.el (erc-process-sentinel-1): Use erc-display-message
+       in several places instead of inserting text.
+       (erc-process-sentinel): Move to the input-marker before removing
+       the prompt.
+
+       * erc.el (erc-port): Fix customization options.
+       (erc-display-message): Handle null type explicitly.  Previously,
+       this was relying on a chance side-effect.  Cosmetic indentation
+       tweak.
+       (english): Add 'finished and 'terminated entries to the catalog.
+       Add initial and terminal newlines to 'disconnected and
+       'disconnected-noreconnect entries.  Avoid long lines.
+
 2006-08-06  Michael Olson  <address@hidden>
 
        * erc-backend.el (erc-server-send-queue): Update from Circe
diff --git a/erc-backend.el b/erc-backend.el
index 62dc017..abee916 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -518,11 +518,7 @@ action."
   (if erc-server-quitting
       ;; normal quit
       (progn
-        (let ((string "\n\n*** ERC finished ***\n")
-              (inhibit-read-only t))
-          (erc-put-text-property 0 (length string)
-                                 'face 'erc-error-face string)
-          (insert string))
+        (erc-display-message nil 'error (current-buffer) 'finished)
         (when erc-kill-server-buffer-on-quit
           (set-buffer-modified-p nil)
           (kill-buffer (current-buffer))))
@@ -544,12 +540,8 @@ action."
         (erc erc-session-server erc-session-port erc-server-current-nick
              erc-session-user-full-name t erc-session-password)
       ;; terminate, do not reconnect
-      (let ((string (concat "\n\n*** ERC terminated: " event
-                            "\n"))
-            (inhibit-read-only t))
-        (erc-put-text-property 0 (length string)
-                               'face 'erc-error-face string)
-        (insert string)))))
+      (erc-display-message nil 'error (current-buffer)
+                           'terminated ?e event))))
 
 (defun erc-process-sentinel (cproc event)
   "Sentinel function for ERC process."
@@ -570,6 +562,7 @@ action."
         (run-hook-with-args 'erc-disconnected-hook
                             (erc-current-nick) (system-name) "")
         ;; Remove the prompt
+        (goto-char (or (marker-position erc-input-marker) (point-max)))
         (forward-line 0)
         (erc-remove-text-properties-region (point) (point-max))
         (delete-region (point) (point-max))
diff --git a/erc.el b/erc.el
index dbe5888..375418c 100644
--- a/erc.el
+++ b/erc.el
@@ -157,8 +157,8 @@ parameters and authentication."
 This can be either a string or a number."
   :group 'erc
   :type '(choice (const :tag "None" nil)
-                (const :tag "Port number" number)
-                (const :tag "Port string" string)))
+                (integer :tag "Port number")
+                (string :tag "Port string")))
 
 (defcustom erc-nick nil
   "Nickname to use if one is not provided.
@@ -2369,6 +2369,8 @@ See also `erc-format-message' and `erc-display-line'."
                  msg)))
     (setq string
          (cond
+          ((null type)
+           string)
           ((listp type)
            (mapc (lambda (type)
                    (setq string
@@ -2381,7 +2383,7 @@ See also `erc-format-message' and `erc-display-line'."
     (if (not (erc-response-p parsed))
        (erc-display-line string buffer)
       (unless (member (erc-response.command parsed) erc-hide-list)
-      (erc-put-text-property 0 (length string) 'erc-parsed parsed string)
+       (erc-put-text-property 0 (length string) 'erc-parsed parsed string)
        (erc-put-text-property 0 (length string) 'rear-sticky t string)
        (erc-display-line string buffer)))))
 
@@ -5959,12 +5961,17 @@ All windows are opened in the current frame."
    (ctcp-request-to . "==> CTCP request from %n (address@hidden) to %t: %r")
    (ctcp-too-many . "Too many CTCP queries in single message. Ignoring")
    (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.")
-   (flood-strict-mode . "FLOOD PROTECTION: Switched to Strict Flood Control 
mode.")
-   (disconnected . "Connection failed!  Re-establishing connection...")
-   (disconnected-noreconnect . "Connection failed!  Not re-establishing 
connection.")
+   (flood-strict-mode
+    . "FLOOD PROTECTION: Switched to Strict Flood Control mode.")
+   (disconnected . "\n\nConnection failed!  Re-establishing connection...\n")
+   (disconnected-noreconnect
+    . "\n\nConnection failed!  Not re-establishing connection.\n")
+   (finished . "\n\n*** ERC finished ***\n")
+   (terminated . "\n\n*** ERC terminated: %e\n")
    (login . "Logging in as \'%n\'...")
    (nick-in-use . "%n is in use. Choose new nickname: ")
-   (nick-too-long . "WARNING: Nick length (%i) exceeds max NICKLEN(%l) defined 
by server")
+   (nick-too-long
+    . "WARNING: Nick length (%i) exceeds max NICKLEN(%l) defined by server")
    (no-default-channel . "No default channel")
    (no-invitation . "You've got no invitation")
    (no-target . "No target")




reply via email to

[Prev in Thread] Current Thread [Next in Thread]