Add 2012 to FSF copyright years for Emacs files
[bpt/emacs.git] / lisp / erc / erc-autoaway.el
index c70beb1..699c4e2 100644 (file)
@@ -1,16 +1,16 @@
 ;;; erc-autoaway.el --- Provides autoaway for ERC
 
-;; Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2002-2004, 2006-2012  Free Software Foundation, Inc.
 
 ;; Author: Jorgen Schaefer <forcer@forcix.cx>
 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ErcAutoAway
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,9 +18,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -47,7 +45,7 @@ This is only used when `erc-autoaway-idle-method' is set to 'emacs.")
   "Indicates whether this module was responsible for setting the
 user's away status.")
 
-(eval-when-compile (defvar erc-autoaway-idle-seconds))
+(defvar erc-autoaway-idle-seconds)
 
 (defun erc-autoaway-reestablish-idletimer ()
   "Reestablish the Emacs idletimer.
@@ -248,7 +246,8 @@ exceeds `erc-autoaway-idle-seconds'."
   ;; A test for (erc-server-process-alive) is not necessary, because
   ;; this function is called from `erc-timer-hook', which is called
   ;; whenever the server sends something to the client.
-  (when (and erc-auto-set-away
+  (when (and erc-server-connected
+            erc-auto-set-away
             (not erc-autoaway-caused-away)
             (erc-autoaway-some-open-server-buffer))
     (let ((idle-time (erc-time-diff erc-autoaway-last-sent-time
@@ -264,7 +263,7 @@ exceeds `erc-autoaway-idle-seconds'."
   "Set the away state globally.
 
 If NOTEST is specified, do not check to see whether there is an
-activer server buffer available."
+active server buffer available."
   ;; Note that the idle timer runs, even when Emacs is inactive.  In
   ;; order to prevent flooding when we connect, we test for an
   ;; existing process.
@@ -285,5 +284,3 @@ activer server buffer available."
 ;; indent-tabs-mode: t
 ;; tab-width: 8
 ;; End:
-
-;; arch-tag: 16fc241e-8358-4b56-9fe2-116bdd0ba3bc