]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc-backend.el
Fix selective diff browsing in Ediff
[gnu-emacs] / lisp / erc / erc-backend.el
index 2c6b03720f02fca12c00149a26da5fb51ccd47c2..8ce199fbcbb02a57762073333f3e85caca66073f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; erc-backend.el --- Backend network communication for ERC
 
-;; Copyright (C) 2004-2014 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2015 Free Software Foundation, Inc.
 
 ;; Filename: erc-backend.el
 ;; Author: Lawrence Mitchell <wence@gmx.li>
@@ -333,7 +333,7 @@ Good luck."
 This will only be consulted if the coding system in
 `erc-server-coding-system' is `undecided'."
   :group 'erc-server
-  :version "24.5"
+  :version "24.1"
   :type '(repeat coding-system))
 
 (defcustom erc-server-coding-system (if (and (fboundp 'coding-system-p)
@@ -400,7 +400,7 @@ isn't displayed."
 (defcustom erc-server-timestamp-format "%Y-%m-%d %T"
   "Timestamp format used with server response messages.
 This string is processed using `format-time-string'."
-  :version "24.5"
+  :version "24.3"
   :type 'string
   :group 'erc-server)
 
@@ -1162,8 +1162,11 @@ add things to `%s' instead."
           (cl-loop for alias in aliases
                    collect (intern (format "erc-server-%s-functions" alias)))))
     `(prog2
-         ;; Normal hook variable.
-         (defvar ,hook-name ',fn-name ,(format hook-doc name))
+         ;; Normal hook variable.  The variable may already have a
+         ;; value at this point, so I default to nil, and (add-hook)
+         ;; unconditionally
+         (defvar ,hook-name nil ,(format hook-doc name))
+         (add-to-list ',hook-name ',fn-name)
          ;; Handler function
          (defun ,fn-name (proc parsed)
            ,fn-doc