]> code.delx.au - gnu-emacs/blobdiff - lisp/erc/erc.el
Update copyright year to 2015
[gnu-emacs] / lisp / erc / erc.el
index c70dfb94d7e496138983887d60b65d7d3ba793e2..7b9a3eb862088ac483896394fd9073e34274af1c 100644 (file)
@@ -1,6 +1,6 @@
 ;; erc.el --- An Emacs Internet Relay Chat client  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1997-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1997-2015 Free Software Foundation, Inc.
 
 ;; Author: Alexander L. Belikoff (alexander@belikoff.net)
 ;; Contributors: Sergey Berezin (sergey.berezin@cs.cmu.edu),
@@ -1005,7 +1005,7 @@ display of that particular string at all."
   "Hook called first when some text is sent through `erc-send-current-line'.
 It gets called with one argument, STRING.
 
-To change the text that will be sent, set the variable STR which is
+To change the text that will be sent, set the variable `str' which is
 used in `erc-send-current-line'.
 
 To change the text inserted into the buffer without changing the text
@@ -5361,6 +5361,7 @@ This returns non-nil only if we actually send anything."
       (beep))
     nil)
    (t
+    (defvar str) ;; FIXME: Make it obey the "erc-" prefix convention.
     (let ((str input)
           (erc-insert-this t))
       (setq erc-send-this t)
@@ -5956,17 +5957,10 @@ Returns a list of the form (HIGH LOW), compatible with Emacs time format."
     (list (truncate (/ n 65536))
           (truncate (mod n 65536)))))
 
-(defun erc-emacs-time-to-erc-time (time)
-  "Convert Emacs TIME to a number of seconds since the epoch."
-  (when time
-    (+ (* (nth 0 time) 65536.0) (nth 1 time))))
-;  (round (+ (* (nth 0 tm) 65536.0) (nth 1 tm))))
+(defalias 'erc-emacs-time-to-erc-time
+  (if (featurep 'xemacs) 'time-to-seconds 'float-time))
 
-(defun erc-current-time ()
-  "Return the `current-time' as a number of seconds since the epoch.
-
-See also `erc-emacs-time-to-erc-time'."
-  (erc-emacs-time-to-erc-time (current-time)))
+(defalias 'erc-current-time 'erc-emacs-time-to-erc-time)
 
 (defun erc-time-diff (t1 t2)
   "Return the time difference in seconds between T1 and T2."