;; 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),
"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
(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)
(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."