Commits

Anonymous committed 570475e

packages: Sync with my upstream erc typo fixes and superseding patch for make-obsolete

-------------------- ChangeLog entries follow: --------------------

xemacs-packages/erc/ChangeLog addition:

2004-03-19 Adrian Aichner <adrian@xemacs.org>

* erc-autoaway.el (erc-autoaway-use-emacs-idle): Sync with my
upstream erc typo fixes and superseding patch for make-obsolete of
upstream erc version 4.0 revision 1.640.
* erc-autoaway.el (erc-auto-set-away): Ditto.
* erc-autoaway.el (erc-auto-discard-away): Ditto.
* erc-autojoin.el (erc-autojoin-version): Ditto.
* erc-autojoin.el (autojoin): Ditto.
* erc-button.el (erc-button-version): Ditto.
* erc-button.el (erc-button-alist): Ditto.
* erc-dcc.el (erc-dcc-version): Ditto.
* erc-dcc.el (erc-dcc-auto-masks): Ditto.
* erc-dcc.el (erc-dcc-chat-send-input-line): Ditto.
* erc-ezbounce.el (erc-ezb-version): Ditto.
* erc-ezbounce.el (erc-ezb-get-login): Ditto.
* erc-imenu.el (erc-imenu-version): Ditto.
* erc-imenu.el (erc-unfill-notice): Ditto.
* erc-list.el: Ditto.
* erc-log.el (erc-enable-logging): Ditto.
* erc-log.el (erc-save-buffer-in-logs): Ditto.
* erc-match.el (erc-match-version): Ditto.
* erc-match.el (match): Ditto.
* erc-match.el (erc-log-matches-types-alist): Ditto.
* erc-match.el (erc-match-directed-at-fool-p): Ditto.
* erc-match.el (erc-match-message): Ditto.
* erc-members.el (erc-update-member): Ditto.
* erc-members.el (erc-ignored-reply-p): Ditto.
* erc-menu.el (erc-menu-definition): Ditto.
* erc-nets.el: Use two argument version of make-obsolete, when
third argument is not supported (for XEmacs).
* erc-nets.el (erc-nets-version): Ditto.
* erc-nets.el (erc-determine-network): Ditto.
* erc-nets.el (erc-network-name): Ditto.
* erc-netsplit.el (erc-netsplit-version): Ditto.
* erc-netsplit.el (erc-netsplit-QUIT): Ditto.
* erc-notify.el (erc-notify-list): Ditto.
* erc-speedbar.el (erc-speedbar-update-channel): Ditto.
* erc-speedbar.el (erc-speedbar-item-info): Ditto.
* erc-stamp.el (erc-stamp-version): Ditto.
* erc-stamp.el (erc-stamp): Ditto.
* erc-stamp.el (erc-timestamp-intangible): Ditto.
* erc-stamp.el (erc-add-timestamp): Ditto.
* erc-stamp.el (erc-insert-timestamp-left): Ditto.
* erc-stamp.el (erc-timestamp-only-if-changed-flag): Ditto.
* erc-stamp.el (erc-show-timestamps): Ditto.
* erc-track.el: Ditto.
* erc-track.el (erc-track-version): Ditto.
* erc-track.el (erc-track-priority-faces-only): Ditto.
* erc-track.el (erc-modified-channels-alist): Ditto.
* erc-track.el (erc-unique-substrings): Ditto.
* erc-track.el (erc-find-parsed-property): Ditto.
* erc-track.el (erc-track-switch-direction): Ditto.
* erc-truncate.el (erc-truncate-buffer-to-size): Ditto.
* erc-xdcc.el (erc-xdcc): Ditto.
* erc.el: Ditto.
* erc.el (erc-version-string): Ditto.
* erc.el (erc-nick-uniquifier): Ditto.
* erc.el (erc-manual-set-nick-on-bad-nick-p): Ditto.
* erc.el (erc-auto-reconnect): Ditto.
* erc.el (erc-startup-file-list): Ditto.
* erc.el (erc-once-with-server-event): Ditto.
* erc.el (erc-once-with-server-event-global): Ditto.
* erc.el (erc-mode): Ditto.
* erc.el (erc-generate-new-buffer-name): Ditto.
* erc.el (erc-buffer-filter): Ditto.
* erc.el (erc): Ditto.
* erc.el (erc-open-ssl-stream): Ditto.
* erc.el (erc-process-sentinel): Ditto.
* erc.el (erc-default-coding-system): Ditto.
* erc.el (erc-coding-sytem-for-target): Removed.
* erc.el (erc-coding-system-for-target): New.
* erc.el (erc-encode-string-for-target): Ditto.
* erc.el (erc-decode-string-from-target): Ditto.
* erc.el (erc-scroll-to-bottom): Ditto.
* erc.el (erc-process-input-line): Ditto.
* erc.el (erc-cmd-PART): Ditto.
* erc.el (erc-quit-reason-zippy): Ditto.
* erc.el (erc-part-reason-zippy): Ditto.
* erc.el (erc-cmd-GQUIT): Ditto.
* erc.el (erc-decode-controls): Ditto.
* erc.el (erc-channel-members-changed-hook): Ditto.
* erc.el (erc-put-text-property): Ditto.
* erc.el (erc-add-default-channel): Ditto.

Comments (0)

Files changed (21)

+2004-03-19  Adrian Aichner  <adrian@xemacs.org>
+
+	* erc-autoaway.el (erc-autoaway-use-emacs-idle): Sync with my
+	upstream erc typo fixes and superseding patch for make-obsolete of
+	upstream erc version 4.0 revision 1.640.
+	* erc-autoaway.el (erc-auto-set-away): Ditto.
+	* erc-autoaway.el (erc-auto-discard-away): Ditto.
+	* erc-autojoin.el (erc-autojoin-version): Ditto.
+	* erc-autojoin.el (autojoin): Ditto.
+	* erc-button.el (erc-button-version): Ditto.
+	* erc-button.el (erc-button-alist): Ditto.
+	* erc-dcc.el (erc-dcc-version): Ditto.
+	* erc-dcc.el (erc-dcc-auto-masks): Ditto.
+	* erc-dcc.el (erc-dcc-chat-send-input-line): Ditto.
+	* erc-ezbounce.el (erc-ezb-version): Ditto.
+	* erc-ezbounce.el (erc-ezb-get-login): Ditto.
+	* erc-imenu.el (erc-imenu-version): Ditto.
+	* erc-imenu.el (erc-unfill-notice): Ditto.
+	* erc-list.el: Ditto.
+	* erc-log.el (erc-enable-logging): Ditto.
+	* erc-log.el (erc-save-buffer-in-logs): Ditto.
+	* erc-match.el (erc-match-version): Ditto.
+	* erc-match.el (match): Ditto.
+	* erc-match.el (erc-log-matches-types-alist): Ditto.
+	* erc-match.el (erc-match-directed-at-fool-p): Ditto.
+	* erc-match.el (erc-match-message): Ditto.
+	* erc-members.el (erc-update-member): Ditto.
+	* erc-members.el (erc-ignored-reply-p): Ditto.
+	* erc-menu.el (erc-menu-definition): Ditto.
+	* erc-nets.el: Use two argument version of make-obsolete, when
+	third argument is not supported (for XEmacs).
+	* erc-nets.el (erc-nets-version): Ditto.
+	* erc-nets.el (erc-determine-network): Ditto.
+	* erc-nets.el (erc-network-name): Ditto.
+	* erc-netsplit.el (erc-netsplit-version): Ditto.
+	* erc-netsplit.el (erc-netsplit-QUIT): Ditto.
+	* erc-notify.el (erc-notify-list): Ditto.
+	* erc-speedbar.el (erc-speedbar-update-channel): Ditto.
+	* erc-speedbar.el (erc-speedbar-item-info): Ditto.
+	* erc-stamp.el (erc-stamp-version): Ditto.
+	* erc-stamp.el (erc-stamp): Ditto.
+	* erc-stamp.el (erc-timestamp-intangible): Ditto.
+	* erc-stamp.el (erc-add-timestamp): Ditto.
+	* erc-stamp.el (erc-insert-timestamp-left): Ditto.
+	* erc-stamp.el (erc-timestamp-only-if-changed-flag): Ditto.
+	* erc-stamp.el (erc-show-timestamps): Ditto.
+	* erc-track.el: Ditto.
+	* erc-track.el (erc-track-version): Ditto.
+	* erc-track.el (erc-track-priority-faces-only): Ditto.
+	* erc-track.el (erc-modified-channels-alist): Ditto.
+	* erc-track.el (erc-unique-substrings): Ditto.
+	* erc-track.el (erc-find-parsed-property): Ditto.
+	* erc-track.el (erc-track-switch-direction): Ditto.
+	* erc-truncate.el (erc-truncate-buffer-to-size): Ditto.
+	* erc-xdcc.el (erc-xdcc): Ditto.
+	* erc.el: Ditto.
+	* erc.el (erc-version-string): Ditto.
+	* erc.el (erc-nick-uniquifier): Ditto.
+	* erc.el (erc-manual-set-nick-on-bad-nick-p): Ditto.
+	* erc.el (erc-auto-reconnect): Ditto.
+	* erc.el (erc-startup-file-list): Ditto.
+	* erc.el (erc-once-with-server-event): Ditto.
+	* erc.el (erc-once-with-server-event-global): Ditto.
+	* erc.el (erc-mode): Ditto.
+	* erc.el (erc-generate-new-buffer-name): Ditto.
+	* erc.el (erc-buffer-filter): Ditto.
+	* erc.el (erc): Ditto.
+	* erc.el (erc-open-ssl-stream): Ditto.
+	* erc.el (erc-process-sentinel): Ditto.
+	* erc.el (erc-default-coding-system): Ditto.
+	* erc.el (erc-coding-sytem-for-target): Removed.
+	* erc.el (erc-coding-system-for-target): New.
+	* erc.el (erc-encode-string-for-target): Ditto.
+	* erc.el (erc-decode-string-from-target): Ditto.
+	* erc.el (erc-scroll-to-bottom): Ditto.
+	* erc.el (erc-process-input-line): Ditto.
+	* erc.el (erc-cmd-PART): Ditto.
+	* erc.el (erc-quit-reason-zippy): Ditto.
+	* erc.el (erc-part-reason-zippy): Ditto.
+	* erc.el (erc-cmd-GQUIT): Ditto.
+	* erc.el (erc-decode-controls): Ditto.
+	* erc.el (erc-channel-members-changed-hook): Ditto.
+	* erc.el (erc-put-text-property): Ditto.
+	* erc.el (erc-add-default-channel): Ditto.
+
 2004-03-11  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 0.06 released.
 
 Note that using Emacs idletime is currently broken for most versions,
 since process activity (as happens all the time on IRC) makes Emacs
-non-idle.  Emacs idle-time and user idel-time are just not the same."
+non-idle.  Emacs idle-time and user idle-time are just not the same."
   :group 'erc-autoaway
   :type 'boolean)
 
 (defcustom erc-auto-set-away t
   "*If non-nil, set away after `erc-autoaway-idle-seconds' seconds of idling.
 ERC autoaway mode can set you away when you idle, and set you no
-longer away when you type something.  This variable controls wether
+longer away when you type something.  This variable controls whether
 you will be set away when you idle.  See `erc-auto-discard-away' for
 the other half."
   :group 'erc-autoaway
 (defcustom erc-auto-discard-away t
   "*If non-nil, sending anything when away automatically discards away state.
 ERC autoaway mode can set you away when you idle, and set you no
-longer away when you type something.  This variable controls wether
+longer away when you type something.  This variable controls whether
 you will be set no longer away when you type something.  See
 `erc-auto-set-away' for the other half."
   :group 'erc-autoaway
 
 ;;;###autoload (autoload 'erc-autojoin-mode "erc-autojoin" nil t)
 (define-erc-module autojoin nil
-  "Makes ERC autjoin on connects and reconnects."
+  "Makes ERC autojoin on connects and reconnects."
   ((add-hook 'erc-after-connect 'erc-autojoin-channels)
    (add-hook 'erc-server-JOIN-hook 'erc-autojoin-add)
    (add-hook 'erc-server-PART-hook 'erc-autojoin-remove))
   strings, or an alist with the strings in the car.  Note that
   entries in lists or alists are considered to be nicks or other
   complete words.  Therefore they are enclosed in \\< and \\>
-  while searching.  REGEXP can also be the quoted symol
+  while searching.  REGEXP can also be the quoted symbol
   'nicknames, which matches the nickname of any user on the
   current server.
 
 
 (defcustom erc-dcc-auto-masks nil
   "List of regexps matching user identifiers whose DCC send offers should be
-accespted automatically.  A user identifier has the form \"nick!login@host\".
-For instance, to accpet all incoming DCC send offers automatically, add the
+accepted automatically.  A user identifier has the form \"nick!login@host\".
+For instance, to accept all incoming DCC send offers automatically, add the
 string \".*!.*@.*\" to this list."
   :group 'erc-dcc
   :type '(repeat regexp))
 
 (defun erc-dcc-chat-send-input-line (recipient line &optional force)
   "Send LINE to the remote end.
-Argument RCIPIENT should always be the symbol dcc, and force
+Argument RECIPIENT should always be the symbol dcc, and force
 is ignored."
   ;; FIXME: We need to get rid of all force arguments one day!
   (if (eq recipient 'dcc)
 (defun erc-ezb-get-login (server port)
   "Return an appropriate EZBounce login for SERVER and PORT.
 Look up entries in `erc-ezb-login-alist'. If the username or password
-in the alist is `nil', prompt for the apropriate values."
+in the alist is `nil', prompt for the appropriate values."
   (let ((login (cdr (assoc (cons server port) erc-ezb-login-alist))))
     (when login
       (let ((username (car login))
 
 (defun erc-unfill-notice ()
   "Return text from point to a computed end as a string unfilled.
-Dont rely on this function, read it first!"
+Don't rely on this function, read it first!"
   (let ((str (buffer-substring
 	      (save-excursion
 		(re-search-forward (regexp-quote erc-notice-prefix)))
-;;; erc-list.el --- Proivde a faster channel listing mechanism
+;;; erc-list.el --- Provide a faster channel listing mechanism
 
 ;; Copyright (C) 2002  Mario Lang
 
    (remove-hook 'erc-send-post-hook
 		'erc-save-buffer-in-logs)))
 
-(add-hook 'erc-kill-buffer-hook
-	  'erc-save-buffer-in-logs)
-(add-hook 'erc-kill-channel-hook
-	  'erc-save-buffer-in-logs)
-(add-hook 'erc-quit-hook
-	  'erc-conditional-save-queries)
-(add-hook 'erc-part-hook
-	  'erc-conditional-save-buffer)
+(when erc-enable-logging
+  (add-hook 'erc-kill-buffer-hook
+            'erc-save-buffer-in-logs)
+  (add-hook 'erc-kill-channel-hook
+            'erc-save-buffer-in-logs)
+  (add-hook 'erc-quit-hook
+            'erc-conditional-save-queries)
+  (add-hook 'erc-part-hook
+            'erc-conditional-save-buffer))
 
 ;;;functionality referenced from erc.el
 (defun erc-log-setup-logging ()
 (defun erc-save-buffer-in-logs (&optional buffer)
   "Append BUFFER contents to the log file, if logging is enabled.
 If BUFFER is not provided, current buffer is used.
-Logging is enabled if `erc-logging-enabbled' returns non-nil.
+Logging is enabled if `erc-logging-enabled' returns non-nil.
 
 This is normally done on exit, to save the unsaved portion of the
 buffer, since only the text that runs off the buffer limit is logged
 
 ;;;###autoload (autoload 'erc-match-mode "erc-match")
 (define-erc-module match nil
-  "This mode checks wether messages match certain patterns.  If so,
+  "This mode checks whether messages match certain patterns.  If so,
 they are hidden or highlighted.  This is controlled via the variables
 `erc-pals', `erc-fools', `erc-keywords', `erc-dangerous-hosts', and
-`erc-current-nick-highlight-type'.  For all these hilighting types,
-you can decide wether the entire message or only the sending nick is
-hilighted."
+`erc-current-nick-highlight-type'.  For all these highlighting types,
+you can decide whether the entire message or only the sending nick is
+highlighted."
   ((add-hook 'erc-insert-modify-hook 'erc-match-message))
   ((remove-hook 'erc-insert-modify-hook 'erc-match-message)))
 
 - dangerous-host
 - fool
 
-The other element of each cons pair in this lits is the buffer name to
+The other element of each cons pair in this list is the buffer name to
 use for the logged message."
   :group 'erc-match
   :type '(repeat (cons (choice :tag "Key"
        (erc-list-match erc-dangerous-hosts nickuserhost)))
 
 (defun erc-match-directed-at-fool-p (msg)
-  "Check wether MSG is directed at a fool.
+  "Check whether MSG is directed at a fool.
 In order to do this, every entry in `erc-fools' will be used.
 In any of the following situations, MSG is directed at an entry FOOL:
 
 	       (erc-put-text-property
 		(point-min) (point-max)
 		'face match-face (current-buffer)))
-              ;; Highlight all occurances of the word to be
+              ;; Highlight all occurrences of the word to be
               ;; highlighted.
 	      ((and (string= match-type "keyword")
                     (eq match-htype 'keyword))
 			    (match-beginning 0) (match-end 0)
 			    'face face))))
 		     match-regex))
-              ;; Highlight all occurances of our nick.
+              ;; Highlight all occurrences of our nick.
 	      ((and (string= match-type "current-nick")
 		    (eq match-htype 'keyword))
 	       (goto-char (+ 2 (or nick-end
   (unless erc-process
     (error "No erc-process in %S" (current-buffer)))
   (when (string= nick new-nick)
-    (setq new-nick nil));; backwards compatiblity
+    (setq new-nick nil));; backwards compatibility
   (let ((person (erc-person nick))
 	(erc-members-changed-hook nil));; call it only once
     (erc-log (format "update-member: old %S" person))
 	  (or (erc-person-host person) "")))
 
 (defun erc-ignored-reply-p (message target process)
-  "Send MESSSAGE to TARGET in PROCESS and maybe return return non-nil.
+  "Send MESSAGE to TARGET in PROCESS and maybe return return non-nil.
 We return non-nil, when MESSAGE is addressed to an ignored user, ie. a user
 matching any regexp in `erc-ignore-reply-list'."
   (let ((target-nick (erc-message-target message)))
              (erc-channel-user-op-p (erc-current-nick)))]
   (list "Channel modes"
         ["Change mode..." erc-insert-mode-command
-               (erc-channel-user-op-p (erc-current-nicK))]
+               (erc-channel-user-op-p (erc-current-nick))]
         ["No external send" (erc-toggle-channel-mode "n")
                :active (erc-channel-user-op-p (erc-current-nick))
          :style toggle :selected (member "n" channel-modes)]
       (intern (cdr (assoc "NETWORK" erc-server-parameters)))
     (or
      ;; Loop through `erc-networks-alist' looking for a match.
-     (loop for (name matcher) in erc-networks-alist
-           when (and matcher
-                     (string-match (concat matcher "\\'")
-                                   erc-announced-server-name))
-           do (return name))
+     (let ((server (or erc-announced-server-name erc-session-server)))
+       (loop for (name matcher) in erc-networks-alist
+             when (and matcher
+                       (string-match (concat matcher "\\'") server))
+             do (return name)))
      'Unknown)))
 
 (defun erc-network ()
   (with-current-buffer (erc-server-buffer)
     (intern (downcase (symbol-name erc-network)))))
 
-(if (featurep 'xemacs)
-    (make-obsolete 'erc-current-network 'erc-network)
-  (make-obsolete 'erc-current-network 'erc-network "Obsolete since erc-nets 1.5"))
+(condition-case nil
+    (make-obsolete 'erc-current-network 'erc-network "Obsolete since erc-nets 1.5")
+  (wrong-number-of-arguments (make-obsolete 'erc-current-network 'erc-network)))
 
 (defun erc-network-name ()
-  "Deprecated.  Use `erc-network' instead.  Return the value of `erc-network'
-as a string."
+  "Returns the name of the current network as a string."
   (with-current-buffer (erc-server-buffer) (symbol-name erc-network)))
 
-(if (featurep 'xemacs)
-    (make-obsolete 'erc-network-name 'erc-network)
-  (make-obsolete 'erc-network-name 'erc-network "Obsolete since erc-nets 1.5"))
+;; Why was this function marked obsolete?  There is no other function that
+;; returns the name of the current network as a string.  Some of us use these
+;; functions in our personal ERC configuration code.  (franl, 2004-03-13)
+;;
+;;(condition-case nil
+;;    (make-obsolete 'erc-network-name 'erc-network "Obsolete since erc-nets 1.5")
+;;  (wrong-number-of-arguments (make-obsolete 'erc-network-name 'erc-network)))
 
 (defun erc-set-network-name (proc parsed)
   "Set `erc-network' to the value returned by `erc-determine-network'."
 	    (setcdr (nthcdr 2 ass) (cons nick (nthcdr 3 ass)))
 	    (when (caddr ass) 
 	      ;; There was already a netjoin for this netsplit, it
-	      ;; seems like the old one didnt get finished...
+	      ;; seems like the old one didn't get finished...
 	      (erc-display-message 
 	       parsed 'notice (process-buffer proc)
 	       'netsplit ?s split)
   :group 'erc)
 
 (defcustom erc-notify-list nil
-  "*List of nicknames you want to be notificated about online/offline status change."
+  "*List of nicknames you want to be notified about online/offline status change."
   :group 'erc-notify
   :type '(repeat string))
 
 
 (defun erc-speedbar-update-channel (buffer)
   "Update the speedbar information about a ERC buffer. The update
-is only done when the channel is acutally expanded already."
-  ;; This is only a rude hack and doesnt care about multiserver usage
+is only done when the channel is actually expanded already."
+  ;; This is only a rude hack and doesn't care about multiserver usage
   ;; yet, consider this a brain storming, better ideas?
   (with-current-buffer speedbar-buffer
     (save-excursion
     (buffer-substring-no-properties (point) (point-at-eol))))
 
 (defun erc-speedbar-item-info ()
-  "Display informatin about the current buffer on the current line."
+  "Display information about the current buffer on the current line."
   (let ((data (speedbar-line-token))
 	(txt (erc-speedbar-line-text)))
     (cond ((and data (listp data))
 of timestamp information in `erc-mode' buffer.
 
 For timestamping to be activated, you just need to load `erc-stamp'
-in your .emacs file or ineractively using `load-library'."
+in your .emacs file or interactively using `load-library'."
   :group 'erc)
 
 (defcustom erc-timestamp-format "[%H:%M]"
   :type 'string)
 
 (defcustom erc-timestamp-intangible t
-  "*Wether the timestamps should be intangible, i.e. prevent the point
+  "*Whether the timestamps should be intangible, i.e. prevent the point
 from entering them and instead jump over them."
   :group 'erc-stamp
   :type 'string)
 (defun erc-add-timestamp ()
   "Add timestamp and text-properties to message.
 
-This function is ment to be called from `erc-insert-modify-hook'
+This function is meant to be called from `erc-insert-modify-hook'
 or `erc-send-modify-hook'."
   (let ((ct (current-time)))
     (if (fboundp erc-insert-timestamp-function)
 			 (list 'point-entered 'erc-echo-timestamp))))
 
 (defun erc-insert-timestamp-left (string)
+  "Insert timestamps at the beginning of the line."
   (goto-char (point-min))
-  (erc-put-text-property 0 (length string) 'field 'erc-timestamp string)
-  (insert string))
+  (if (and erc-timestamp-only-if-changed-flag
+           (string-equal string erc-timestamp-last-inserted))
+      (insert (make-string (length string) ? ))
+    (setq erc-timestamp-last-inserted string)
+    (erc-put-text-property 0 (length string) 'field 'erc-timestamp string)
+    (insert string)))
 
 (defvar erc-timestamp-last-inserted nil
   "Last timestamp inserted into the buffer.")
 (make-variable-buffer-local 'erc-timestamp-last-inserted)
 
 (defcustom erc-timestamp-only-if-changed-flag t
-  "*Insert only if timestamp actually changed since last insertion.
-This only works with `erc-timestamp-rgiht'."
+  "*Insert timestamp only if its value changed since last insertion.
+If `erc-insert-timestamp-function' is `erc-insert-timestamp-left', a
+string of spaces which is the same size as the timestamp is added to
+the beginning of the line in its place. If you use
+`erc-insert-timestamp-right', nothing gets inserted in place of the
+timestamp."
   :group 'erc-stamp
   :type 'boolean)
 
   (erc-munge-invisibility-spec))
 
 (defun erc-show-timestamps ()
-  "Show timestamp ifnormation on display.
+  "Show timestamp information on display.
 This function only works if `erc-timestamp-format' was previously
 set, and timestamping is already active."
   (interactive)
 
 ;;; Commentary:
 
-;; Highlights keywords and pals (friends), and hides or hilights fools
+;; Highlights keywords and pals (friends), and hides or highlights fools
 ;; (using a dark color).  Add to your ~/.emacs:
 
 ;; (require 'erc-track)
 this variable.  You can set a list of channel name strings, so those
 will be ignored while all other channels will be tracked as normal.
 Other options are 'all, to apply this to all channels or nil, to disable
-thsi feature.
+this feature.
 Note: If you have a lot of faces listed in erc-track-faces-priority-list,
 setting this variable might not be very useful."
   :group 'erc-track
 when displaying the buffer's name.  See `erc-track-faces-priority-list',
 and `erc-track-showcount'.
 
-Entries in this list should only happen for buffers where activity occured
+Entries in this list should only happen for buffers where activity occurred
 while the buffer was not visible.")
 
 ;;; Shortening of names
 	   ;; do not shorten if a predicate exists and it returns nil
 	   str
 	 ;; Start with smallest substring candidate, ie. length 1.
-	 ;; Then check all the others and see wether any of them starts
+	 ;; Then check all the others and see whether any of them starts
 	 ;; with the same substring.  While there is such another
 	 ;; element in the list, increase the length of the candidate.
 	 (while (not done)
 	   (erc-unique-channel-names
 	    '("#linux-de" "#linux-fr")
 	    '("#linux-de" "#linux-fr")))
-	 '("#linux-d" "#linux-f")); now we want to be agressive
+	 '("#linux-d" "#linux-f")); now we want to be aggressive
   ;; specific problems
   (equal (let ((erc-track-shorten-aggressively nil))
 	   (erc-unique-channel-names
    (erc-faces-in str)))
 
 (defun erc-find-parsed-property ()
-  "Find the next occurence of the `erc-parsed' text property."
+  "Find the next occurrence of the `erc-parsed' text property."
   (let ((pos (point-min)))
     (while (and pos (not (get-text-property pos 'erc-parsed)))
       (setq pos (next-single-property-change pos 'erc-parsed)))
   "Direction `erc-track-switch-buffer' should switch.
 'oldest will find the oldest active buffer.
 'newest finds the latest, 'leastactive finds buffer with least unseen messages,
-'mostactive - with most unseeen messages."
+'mostactive - with most unseen messages."
   :group 'erc-track
   :type '(choice (const oldest) (const newest) (const leastactive) (const mostactive)))
 
 (defun erc-truncate-buffer-to-size (size &optional buffer)
   "Truncates the buffer to the size SIZE.
 If BUFFER is not provided, the current buffer is assumed.  The deleted
-region is logged if `erc-logging-enabbled' returns non-nil."
+region is logged if `erc-logging-enabled' returns non-nil."
   ;; If buffer is non-nil, but get-buffer does not return anything,
   ;; then this is a bug.  If buffer is a buffer name, get the buffer
   ;; object.  If buffer is nil, use the current buffer.
 	(funcall handler proc nick login host (cdr args))
       (erc-xdcc-reply
        proc nick
-       (format "Unknwon XDCC sub-command, try \"/ctcp %s XDCC help\""
+       (format "Unknown XDCC sub-command, try \"/ctcp %s XDCC help\""
 	       (erc-current-nick))))))
 
 (defun erc-xdcc-help (proc nick login host args)
 
 (defcustom erc-nick-uniquifier "`"
   "The character to append to the nick if it is already in use."
+  :group 'erc
   :type 'string)
 
 (defcustom erc-manual-set-nick-on-bad-nick-p nil
   "If the nickname you chose isn't available, ERC should not automatically
 attempt to set another nickname.  You can manually set another nickname with
 the /NICK command."
+  :group 'erc
   :type 'boolean)
 
 (defcustom erc-user-full-name nil
   :type 'boolean)
 
 (defcustom erc-auto-reconnect t
-  "Non-nil means that ERC will attempt to restablish broken connections.
+  "Non-nil means that ERC will attempt to reestablish broken connections.
 
 Reconnection will happen automatically for any unexpected disconnection."
   :group 'erc
 (defcustom erc-startup-file-list
   '("~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
   "List of files to try for a startup script.
-The first existant and readable one will get executed.
+The first existent and readable one will get executed.
 
 If the filename ends with `.el' it is presumed to be an emacs-lisp
 script and it gets (load)ed.  Otherwise is is treated as a bunch of
 	      event)
 	     (t
 	      (error
-	       "EVENT should be a symbol or a numer")))
+	       "EVENT should be a symbol or a number")))
 	    "-hook"))
 
   (defun erc-event-to-hook (event)
 
 You should make sure that `current-buffer' is a server buffer.
 
-This function temporarily adds a functon to EVENT's hook to
+This function temporarily adds a function to EVENT's hook to
 execute FORMS.  After FORMS are run, the function is removed from
 EVENT's hook.  The last expression of FORMS should be either nil
 or t.  nil indicates that the other functions on EVENT's hook
 (defun erc-once-with-server-event-global (event &rest forms)
   "Execute FORMS the next time EVENT occurs in any server buffer.
 
-This function temporarily prepends a functon to EVENT's hook to
+This function temporarily prepends a function to EVENT's hook to
 execute FORMS.  After FORMS are run, the function is removed from
 EVENT's hook.  The last expression of FORMS should be either nil
 or t.  nil indicates that the other functions on EVENT's hook
   ;; This seems to work only in CVS emacs. "GNU Emacs 21.2.2" has
   ;; problems with this:
   ;; (string-match "[^ ]" "foo bar") returns nil.
-  ;; And XEmacs doesnt have set-case-syntax-pair :(...
+  ;; And XEmacs doesn't have set-case-syntax-pair :(...
 ;;  (when (and (>= emacs-major-version 21)
 ;;	     (>= emacs-minor-version 3))
 ;;    (set-case-table
 		       (or (let ((name (concat server ":" port)))
 			     (when (> (length name) 1)
 			       name))
-			   ; This fallback should infact never happen
+			   ; This fallback should in fact never happen
 			   "*erc-server-buffer*"))))
     ;; Reuse existing buffers, but not if the buffer is a connected server
     ;; buffer and not if its associated with a different server than the
     (delq
      nil
      (mapcar (lambda (buf)
-	       (set-buffer buf)
-	       (and (eq major-mode 'erc-mode)
-		    (or (not proc)
-			(eq proc erc-process))
-		    (funcall predicate)
-		    buf))
+	       (with-current-buffer buf
+		 (and (eq major-mode 'erc-mode)
+		      (or (not proc)
+			  (eq proc erc-process))
+		      (funcall predicate)
+		      buf)))
 	     (buffer-list)))))
 
 (defun erc-buffer-list (&optional predicate proc)
 non-nil, connect to the server.  Otherwise assume already
 connected and just create a separate buffer for the new target
 CHANNEL.  Use PASSWD as user password on the server.  If TGT-LIST
-is non-nil, use it to initialise `erc-default-recipiets'.
+is non-nil, use it to initialise `erc-default-recipients'.
 
 Returns the buffer for the given server or channel."
   (let ((announced-server-name (when (and (boundp 'erc-session-server)
     (setq erc-process process)
     (setq erc-insert-marker (make-marker))
     (set-marker erc-insert-marker (point))
-    ;; stack of default recepients
+    ;; stack of default recipients
     (setq erc-default-recipients tgt-list)
     ;; stack for user's nicknames
     (setq current-nick nil)
     (let ((proc (open-ssl-stream name buffer host port)))
       ;; Ugly hack, but it works for now. Problem is it is
       ;; very hard to detect when ssl is established, because s_client
-      ;; doesnt give any CONNECTIONESTABLISHED kind of message, and
+      ;; doesn't give any CONNECTIONESTABLISHED kind of message, and
       ;; most IRC servers send nothing and wait for you to identify.
       (sit-for 5)
       proc)))
      ;; default to this
      (t
       (erc-with-all-buffers-of-server cproc nil (setq erc-connected nil))
+      (when erc-ping-handler
+	(with-current-buffer (current-buffer)
+	  (progn (cancel-timer erc-ping-handler)
+		 (setq erc-ping-handler nil))))
       (run-hook-with-args 'erc-disconnected-hook
 			  (erc-current-nick) (system-name) "")
       (if (string= event "exited abnormally with code 256\n")
 If a function, it is called with no should return a coding system
 or a cons as described above.  Note that you can use the
 dynamically bound variable `target' to get the current target.
-See `erc-coding-sytem-for-target'.
+See `erc-coding-system-for-target'.
 
 If you need to send non-ASCII text to people not using a client that
 does decoding on its own, you must tell ERC what encoding to use.
   :type '(repeat (cons (string :tag "Target")
 		       coding-system)))
 
-(defun erc-coding-sytem-for-target (target)
+(defun erc-coding-system-for-target (target)
   "Return the coding system or cons cell appropriate for TARGET.
 This is determined via `erc-encoding-coding-alist' or
 `erc-default-coding-system'."
   "Encode STR as appropriate for TARGET.
 This is indicated by `erc-encoding-coding-alist', defaulting to the value of
 `erc-default-coding-system'."
-  (let ((coding (erc-coding-sytem-for-target target)))
+  (let ((coding (erc-coding-system-for-target target)))
     (when (consp coding)
       (setq coding (car coding)))
     (erc-encode-coding-string str coding)))
   "Decode STR as appropriate for TARGET.
 This is indicated by `erc-encoding-coding-alist', defaulting to the value of
 `erc-default-coding-system'."
-  (let ((coding (erc-coding-sytem-for-target target)))
+  (let ((coding (erc-coding-system-for-target target)))
     (when (consp coding)
       (setq coding (cdr coding)))
     (erc-decode-coding-string str coding)))
 
 DISPLAY-START is ignored."
   (if (and window (window-live-p window))
-      ;; Temporarilly bind resize-mini-windows to nil so that users who have it
+      ;; Temporarily bind resize-mini-windows to nil so that users who have it
       ;; set to a non-nil value will not suffer from premature minibuffer
       ;; shrinkage due to the below recenter call.  I have no idea why this
       ;; works, but it solves the problem, and has no negative side effects.
 	     (erc-display-message nil 'error (current-buffer) 'incorrect-args
 				  ?c cmd
 				  ?u (erc-get-arglist cmd)
-				  ?d (or (documentation cmd) "")))))
+				  ?d (format "%s\n"
+					     (or (documentation cmd) ""))))))
       (let ((r (erc-default-target)))
 	(if r
 	    (funcall erc-send-input-line-function r line force)
 	   (format "PART %s" ch)
 	 (format "PART %s :%s" ch reason))))
     t)
-   ((string-match "^\\(.*\\)$" line)
+   ((string-match "^\\s-*\\(.*\\)$" line)
     (let* ((ch (erc-default-target))
 	   (msg (match-string 1 line))
 	   (reason (funcall erc-part-reason (if (equal msg "") nil msg))))
   "Zippy quit message.
 
 If S is non-nil, it will be used as the quit reason."
-  (or s ;; FIXME: It seems to me that we should ignore S in this case --
-        ;; Lawrence 2004-01-08
+  (or s
       (erc-replace-regexp-in-string "\n" "" (yow))))
 
 (defun erc-quit-reason-various (s)
   "Zippy part message.
 
 If S is non-nil, it will be used as the quit reason."
-  (or s ;; FIXME: It seems to me that we should ignore S in this case --
-        ;; Lawrence 2004-01-08
+  (or s
       (erc-replace-regexp-in-string "\n" "" (yow))))
 
 (defun erc-part-reason-various (s)
 
 (defun erc-cmd-GQUIT (reason)
   "Disconnect from all servers at once with the same quit REASON."
-  (erc-with-all-buffers-of-server nil #'erc-server-buffer-p
+  (erc-with-all-buffers-of-server nil #'(lambda ()
+					  (and (erc-server-buffer-p)
+					       (erc-process-alive)))
 				  (erc-cmd-QUIT "")))
+
 (defalias 'erc-cmd-GQ 'erc-cmd-GQUIT)
 (put 'erc-cmd-GQUIT 'do-not-parse-args t)
 
 	    inv	 (get-text-property pos 'erc-inv line))
       (setq next-pos (next-property-change pos line))
       ;; put "end of color" only if not at the beginning of line,
-      ;; and the color was on.	Also put it if the bg color dissapeared
+      ;; and the color was on.	Also put it if the bg color disappeared
       (if (or (and col (not fg) (not bg) (/= pos 0))
 	      (and (not bg) bg0))
 	  (setq res (concat res "\C-c")))
     (run-hooks 'erc-channel-members-changed-hook)))
 
 (defcustom erc-channel-members-changed-hook nil
-  "*This hook is called everytime the variable `channel-members' changes.
+  "*This hook is called every time the variable `channel-members' changes.
 The buffer where the change happened is current while this hook is called."
   :group 'erc-hooks
   :type 'hook)
 OBJECT is a string which will be modified and returned.
 OBJECT is modified without being copied first.
 
-You can redefine or `defavice' this function in order to add
+You can redefine or `defadvice' this function in order to add
 EmacsSpeak support."
   (put-text-property start end property value object))
 
 ;;; This is no longer true.  The channel is added to another window
 ;;; and we don't want to mess the target there.
 ;"If the current default
-;recepient is of QUERY type, then push the new default channel *after*
+;recipient is of QUERY type, then push the new default channel *after*
 ;the head"
 
   (let ((d1 (car erc-default-recipients))